_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs

57 lines
1.4 KiB
C#
Raw Normal View History

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-14 18:11:08 +08:00
public AllHouseContro allHouseContro;
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-15 12:09:52 +08:00
//StartCoroutine(StartGame());
2024-11-14 18:11:08 +08:00
2024-11-13 12:06:05 +08:00
2024-11-12 14:06:34 +08:00
}
private void Update()
{
2024-11-14 18:11:08 +08:00
//Debug.Log("carrySeconds:" + InfoObject.GetComponent<selectGameEscape512>().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
{
2024-11-14 18:11:08 +08:00
allHouseContro.ControAllDoorOpen();
2024-11-12 14:06:34 +08:00
while (timeNum >=0)
{
2024-11-14 18:11:08 +08:00
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>
2024-11-15 12:09:52 +08:00
//timeNum -= 1;
2024-11-13 18:01:18 +08:00
2024-11-15 12:09:52 +08:00
if (timeNum==20)
2024-11-13 18:01:18 +08:00
{
2024-11-14 18:11:08 +08:00
allHouseContro.ControAllDoorClose();
2024-11-13 18:01:18 +08:00
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>");
2024-11-14 18:11:08 +08:00
2024-11-13 02:03:11 +08:00
BossContro.instance.BossMove();
2024-11-15 12:09:52 +08:00
//timeNum = 60;
}
public void HadInfAndStartGame()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
{
timeNum=60-InfoObject.GetComponent<selectLatest511>().carrySeconds;
StartCoroutine(StartGame());
2024-11-12 14:06:34 +08:00
}
}