consolidate all repos to one for archive
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
public class TimerSk3 : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI mssg;
|
||||
float timePlaying;
|
||||
|
||||
private bool gameOn;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
timePlaying = 0;
|
||||
gameOn = true;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (gameOn)
|
||||
{
|
||||
timePlaying += Time.deltaTime;
|
||||
|
||||
int sec = (int)timePlaying % 60;
|
||||
int min = (int)(timePlaying / 60);
|
||||
|
||||
mssg.text = string.Format("{0:00}:{1:00}", min, sec);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopTimer()
|
||||
{
|
||||
gameOn = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user