public virtual void HideWindow() { if (WindowRoot != null) { if (WindowRoot.activeSelf) {//当前窗口是显示状态 if (GlobalEnvironment.Singleton.IsInCallbackOrTrigger) { DelegateCoroutine.CallStartCoroutine(WindowRoot, HideWindowImpl()); return; } WindowRoot.SetActive(false); } OnHideWindow(); if (JoystickMap != null) { JoystickMap.OnDestroy(); } } else { m_cacheStatus |= CachedStatus.Visible; m_cacheVisiable = false; } }
public static Coroutine CallStartCoroutine(GameObject obj, IEnumerator routine) { DelegateCoroutine mono = obj.GetComponent<DelegateCoroutine>(); if (mono == null) { mono = obj.AddComponent<DelegateCoroutine>(); } if (mono == null) { return MainGame.Singleton.StartCoroutine(routine); } return mono.StartCoroutine(routine); }
public Coroutine StartCoroutine(IEnumerator routine) { if (WindowRoot == null) { return(null); } DelegateCoroutine mono = WindowRoot.GetComponent <DelegateCoroutine>(); if (mono == null) { mono = WindowRoot.AddComponent <DelegateCoroutine>(); } return(mono.StartCoroutine(routine)); }