using BigSpace.Logic; using BigSpace.XRCore.Event; using BigSpace.XRCore.RunningScene; using System.Collections; using System.Collections.Generic; using UnityEngine; public class StartShowUICtr : MonoBehaviour { public GameObject sceneTitle; bool oIsRun = false; float oneWaitTime = 3f; float oneRunTime = 0; private void Awake() { //for (int i = 0; i < ListObj.Count; i++) //{ // ListObj[i].SetActive(false); //} } // Start is called before the first frame update void Start() { // GlobalEventMgr.Listen(GameEvent.EventRestScenePosition, GameDataManage_EventRestScenePosition); // SetVolume(false); StartCoroutine(WaitingShowUI()); //��ʾUI // ChangSceneSphereMgr.Instance.ShowChangeSecne(false);//����䵭 } private void Update() { if (oIsRun) { oneRunTime += Time.deltaTime; sceneTitle.transform.position = Camera.main.transform.position + Camera.main.transform.forward * 1; sceneTitle.transform.LookAt(Camera.main.transform); if (oneRunTime >= oneWaitTime) { oIsRun = false; oneRunTime = 0; sceneTitle.gameObject.SetActive(false); } } } private void OnDestroy() { // GlobalEventMgr.Remove(GameEvent.EventRestScenePosition); } IEnumerator WaitingShowUI() { yield return new WaitForSeconds(1f); if (sceneTitle != null) { oIsRun = true; oneRunTime = 0; sceneTitle.SetActive(true); } else { //Debug.Log("WaitingShowUI" + RunningSceneMgr.Instance._runningSceneData.id); GlobalEventMgr.Dispatch(GameEvent.EventShowUI, RunningSceneMgr.Instance._runningSceneData.id % 10000); } } }