public virtual CDefaultPopup ClosePopup(string popupName) { if (this.m_PopupMaps.ContainsKey(popupName)) { this.m_PopupMaps[popupName].GameObject.transform.SetParent(this.m_TopCanvas.transform); this.m_PopupMaps[popupName].GameObject.transform.SetAsLastSibling(); this.m_PopupMaps[popupName].OnDestroyObject(); this.m_PopupMaps[popupName].SetObjectSceneAnimatorAsync(CGameSetting.ANIM_OBJECT, "IsShow", false, (go) => { this.m_PopupMaps[popupName].GameObject.transform.SetParent(this.m_MainCanvas.transform); go.SetActive(false); }); if (this.m_CurrentPopup != null && this.m_CurrentPopup.sceneObjectName == popupName) { this.m_CurrentPopup = null; } return(this.m_PopupMaps[popupName]); } return(null); }
public virtual CDefaultPopup ShowPopup(string popupName, bool savePath = true) { if (string.IsNullOrEmpty(popupName)) { return(null); } if (this.m_PopupMaps.ContainsKey(popupName) == false) { return(null); } // ROAD MAP if (savePath) { this.AddRoadMap(popupName); } // ROOT OBJECT this.m_RootObject = this.m_PopupMaps[popupName]; // CURRENT POPUP if (this.m_CurrentPopup != null && this.m_CurrentPopup.sceneObjectName == popupName) { this.m_CurrentPopup.SetActive(true); this.m_CurrentPopup.SetObjectSceneAnimator("IsShow", true); this.m_CurrentPopup.GameObject.transform.SetParent(this.m_TopCanvas.transform); this.m_CurrentPopup.GameObject.transform.SetAsLastSibling(); return(this.m_CurrentPopup); } // ACTIVE && AWAKE if (this.m_PopupMaps.ContainsKey(popupName)) { this.m_PopupMaps[popupName].SetActive(true); this.m_PopupMaps[popupName].OnStartObject(); this.m_PopupMaps[popupName].SetObjectSceneAnimator("IsShow", true); this.m_PopupMaps[popupName].GameObject.transform.SetParent(this.m_TopCanvas.transform); this.m_PopupMaps[popupName].GameObject.transform.SetAsLastSibling(); this.m_CurrentPopup = this.m_PopupMaps[popupName]; } // RETURN return(this.m_CurrentPopup); }