using BigSpace.Logic; using BigSpace.XRCore.Base; using BigSpace.XRCore.Event; using BigSpace.XRCore.Video; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; using UnityEngine.Video; public class UIPanelControll : MonoSingleton { public List ListUiImg; //计时相关 bool isRun = false; float waitTime = 5f; float runTime = 0; int nowIndex = 0; //当前下标 void Start() { GlobalEventMgr.Listen(GameEvent.EventShowUI, GameDataManage_EventShowUI); } private void Update() { if (isRun) { runTime += Time.deltaTime; if (runTime >= waitTime) { isRun = false; runTime = 0; ListUiImg[nowIndex].gameObject.SetActive(false); } } } void GameDataManage_EventShowUI(int index) { if (index == 0|| index == 7) { nowIndex = index; ListUiImg[nowIndex].gameObject.SetActive(true); if (index != 7) isRun = true; else { if (index == 7) { waitTime = 11; isRun = true; } } } } }