_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs
2024-11-13 18:01:18 +08:00

47 lines
978 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HegemonTime : MonoBehaviour
{
public static HegemonTime instance;
public Text timeText;
public int timeNum;
public int carrySeconds;
// Start is called before the first frame update
void Start()
{
instance = this;
timeNum = 60;
StartCoroutine(StartGame());
}
private void Update()
{
}
public IEnumerator StartGame()
{
while (timeNum >=0)
{
timeText.text = (timeNum-carrySeconds).ToString(); // 显示整数秒数
yield return new WaitForSeconds(1f); // 等待1秒
timeNum -= 1;
if (timeNum<=20)
{
MaskContro.instance.SetMask(true);
}
}
Debug.Log("Boos来了");
BossContro.instance.BossMove();
timeNum = 60;
}
}