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(); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
yield return new WaitForSeconds(1f); // <20>ȴ<EFBFBD>1<EFBFBD><31>
|
|||
|
timeNum -= 1;
|
|||
|
}
|
|||
|
timeNum = 60;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|