c# Scondstimer.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using TMPro;
using UnityEngine.UI;
public class StudyTime : MonoBehaviour
{
public GameObject timerText;
private float time=0.0f;
private int minute=0;
void Start()
{
}
// Update is called once per frame
void Update()
{
this.time += Time.deltaTime;
if(this.time<10.0f)
{
this.timerText.GetComponent<TextMeshProUGUI>().text =this.time.ToString("F1");
}
else
{
this.time=10.0f;
this.timerText.GetComponent<TextMeshProUGUI>().text =this.time.ToString("F1");
if (Input.GetKeyDown(KeyCode.Return))
{
SceneManager.LoadScene("Sccess");
}
}
}
}