mirror of
https://github.com/Fluffy-Bean/Again.git
synced 2025-07-01 13:36:17 +00:00
Yeet
This commit is contained in:
parent
99cfaa4793
commit
90cf5a6112
90 changed files with 17097 additions and 0 deletions
38
timerText.cs
Normal file
38
timerText.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class timerText : MonoBehaviour
|
||||
{
|
||||
|
||||
TextMeshProUGUI textBox;
|
||||
|
||||
public float time = 0;
|
||||
protected float Timer;
|
||||
public int delayAmount = 1;
|
||||
|
||||
void Start()
|
||||
{
|
||||
textBox = GetComponent<TextMeshProUGUI>();
|
||||
textBox.SetText("0");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (SceneManager.GetActiveScene().name == "game")
|
||||
{
|
||||
Timer += Time.deltaTime;
|
||||
|
||||
if (Timer >= delayAmount)
|
||||
{
|
||||
Timer = 0f;
|
||||
time++;
|
||||
textBox.SetText("{0}", time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue