This commit is contained in:
Michal 2022-05-13 16:23:52 +01:00 committed by GitHub
parent 99cfaa4793
commit 90cf5a6112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 17097 additions and 0 deletions

38
timerText.cs Normal file
View 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);
}
}
}
}