public static bool Show(int level, GameUIPopupManager.PopClosedCallback cb = null, GameUIPopupManager.PopClosedCallback cb2 = null) { if (string.IsNullOrEmpty(Singleton<StringManager>.Instance.GetUnlockImage(level))) { return false; } GameUIPopupManager.GetInstance().PushState(GameUIPopupManager.eSTATE.GUIUnlockPopUp, false, null, cb2); GameUIPopupManager.GetInstance().GetCurrentPopup().InitPopUp(level); return true; }
public void Init(Transform parent, GameUIPopupManager.PopClosedCallback callback) { this.CreateObjects(); Transform transform = base.transform; transform.parent = parent; transform.localPosition = new Vector3(0f, 0f, -1000f); transform.localScale = Vector3.one; this.mCloseCallback = callback; this.ShowLevelupPanel(); Globals.Instance.EffectSoundMgr.Play("ui/ui_014"); this.levelBtnClose = this.levelupWinBg.transform.FindChild("closeBtn").gameObject; UIEventListener expr_86 = UIEventListener.Get(this.levelBtnClose); expr_86.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_86.onClick, new UIEventListener.VoidDelegate(this.OnLevelBtnCloseClick)); UIEventListener expr_C6 = UIEventListener.Get(this.levelupBg.transform.FindChild("resultWindow").gameObject); expr_C6.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_C6.onClick, new UIEventListener.VoidDelegate(this.OnLevelBtnCloseClick)); }
private GameUIBasePopup CreatePopup(GameUIPopupManager.eSTATE eState) { this.mStringBuilder.Remove(0, this.mStringBuilder.Length); this.mStringBuilder.Append("GUI/").Append(eState.ToString()); GameObject gameObject = Res.LoadGUI(this.mStringBuilder.ToString()); if (gameObject == null) { global::Debug.LogError(new object[] { "Res.Load GUI/MessageTip error" }); return null; } GameObject gameObject2 = NGUITools.AddChild(GameUIManager.mInstance.uiCamera.gameObject, gameObject); if (gameObject2 == null) { global::Debug.LogError(new object[] { "AddChild error" }); return null; } GameUIBasePopup gameUIBasePopup = gameObject2.GetComponent(eState.ToString()) as GameUIBasePopup; if (gameUIBasePopup == null) { gameUIBasePopup = (gameObject2.AddComponent(eState.ToString()) as GameUIBasePopup); } gameUIBasePopup.gameObject.SetActive(true); GameObject gameObject3 = Res.LoadGUI("GUI/GameUIButtonBlocker"); if (gameObject3 == null) { global::Debug.LogError(new object[] { "Res.Load GUI/GameUIButtonBlocker error" }); return null; } this.mButtonBlocker = NGUITools.AddChild(GameUIManager.mInstance.uiCamera.gameObject, gameObject3); UIEventListener expr_13A = UIEventListener.Get(this.mButtonBlocker); expr_13A.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_13A.onClick, new UIEventListener.VoidDelegate(this.OnButtonBlockerClick)); this.mCurPopup = gameUIBasePopup; this.SetCurrentPopupPanel(5400, 400, 3000); return gameUIBasePopup; }
private static void CreateInstance() { GameUIPopupManager.mInstance = new GameObject("GameUIPopupManager").AddComponent<GameUIPopupManager>(); Tools.Assert(GameUIPopupManager.mInstance, "GameUIPopupManager cant find."); }
public void PushState(GameUIPopupManager.eSTATE eState, bool isCloseNow = false, GameUIPopupManager.PopClosedCallback cb = null, GameUIPopupManager.PopClosedCallback cb2 = null) { this.mPushShowedCallbackEvent = cb; this.mPopClosedCallbackEvent2 = cb2; if (this.GetState() != eState) { this.mStateStack.Push(eState); if (eState == GameUIPopupManager.eSTATE.None) { this.SetStateNone(isCloseNow); } else { if (this.mCurPopup != null) { this.mCurPopup.gameObject.SetActive(false); UnityEngine.Object.Destroy(this.mCurPopup.gameObject); this.mButtonBlocker.gameObject.SetActive(false); UnityEngine.Object.Destroy(this.mButtonBlocker.gameObject); } this.CreatePopup(eState); this.StartAnimation(); } } }
public void PopState(bool isCloseNow = false, GameUIPopupManager.PopClosedCallback cb = null) { this.mPopClosedCallbackEvent = cb; if (this.mStateStack.Count <= 1) { this.SetStateNone(isCloseNow); } else { this.EndAnimation(isCloseNow); } }