34 lines
666 B
C#
34 lines
666 B
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
|
||
public class HegemonTime : MonoBehaviour
|
||
{
|
||
public Text timeText;
|
||
public int timeNum;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
timeNum = 60;
|
||
StartCoroutine(StartGame());
|
||
}
|
||
|
||
private void Update()
|
||
{
|
||
|
||
}
|
||
private IEnumerator StartGame()
|
||
{
|
||
while (timeNum >=0)
|
||
{
|
||
timeText.text = timeNum.ToString(); // ÏÔʾÕûÊýÃëÊý
|
||
yield return new WaitForSeconds(1f); // µÈ´ý1Ãë
|
||
timeNum -= 1;
|
||
}
|
||
timeNum = 60;
|
||
|
||
}
|
||
|
||
}
|