_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs
2024-11-12 14:06:34 +08:00

34 lines
666 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}