original ver 25/06/01
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class runningTime : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
|
||||
public TextMeshProUGUI allRunningTime;
|
||||
public AudioSource bgMusicAudioSource;
|
||||
|
||||
private bool isPlayingSong = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
//allRunningTime.text = "0.00";
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
allRunningTime.text = Time.time.ToString("F2");
|
||||
if (Time.time > 0 && isPlayingSong == false)
|
||||
{
|
||||
bgMusicAudioSource.Play(4);
|
||||
isPlayingSong = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user