2024-11-12 14:06:34 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class HegemonTime : MonoBehaviour
|
|
|
|
|
{
|
2024-11-13 02:03:11 +08:00
|
|
|
|
public static HegemonTime instance;
|
2024-11-12 14:06:34 +08:00
|
|
|
|
public Text timeText;
|
|
|
|
|
public int timeNum;
|
2024-11-13 12:06:05 +08:00
|
|
|
|
public int carrySeconds;
|
2024-11-13 23:15:46 +08:00
|
|
|
|
public GameObject InfoObject;
|
2024-11-12 14:06:34 +08:00
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
2024-11-13 02:03:11 +08:00
|
|
|
|
instance = this;
|
2024-11-13 12:06:05 +08:00
|
|
|
|
timeNum = 60;
|
2024-11-12 14:06:34 +08:00
|
|
|
|
StartCoroutine(StartGame());
|
2024-11-13 12:06:05 +08:00
|
|
|
|
|
|
|
|
|
|
2024-11-12 14:06:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
{
|
2024-11-14 18:09:37 +08:00
|
|
|
|
// Debug.Log("carrySeconds:" + InfoObject.GetComponent<selectLatest511>().carrySeconds);
|
2024-11-12 14:06:34 +08:00
|
|
|
|
|
|
|
|
|
}
|
2024-11-13 02:03:11 +08:00
|
|
|
|
public IEnumerator StartGame()
|
2024-11-12 14:06:34 +08:00
|
|
|
|
{
|
|
|
|
|
while (timeNum >=0)
|
|
|
|
|
{
|
2024-11-13 12:06:05 +08:00
|
|
|
|
timeText.text = (timeNum-carrySeconds).ToString(); // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-11-12 14:06:34 +08:00
|
|
|
|
yield return new WaitForSeconds(1f); // <20>ȴ<EFBFBD>1<EFBFBD><31>
|
|
|
|
|
timeNum -= 1;
|
2024-11-13 18:01:18 +08:00
|
|
|
|
|
|
|
|
|
if (timeNum<=20)
|
|
|
|
|
{
|
|
|
|
|
MaskContro.instance.SetMask(true);
|
|
|
|
|
}
|
2024-11-12 14:06:34 +08:00
|
|
|
|
}
|
2024-11-13 18:01:18 +08:00
|
|
|
|
|
2024-11-13 02:03:11 +08:00
|
|
|
|
Debug.Log("Boos<6F><73><EFBFBD><EFBFBD>");
|
|
|
|
|
BossContro.instance.BossMove();
|
2024-11-13 18:01:18 +08:00
|
|
|
|
timeNum = 60;
|
2024-11-12 14:06:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|