public override void Initialize() { base.Initialize(); //加载Canvas TraCanvas = LoadCanvas(); //获得Normal TraNormal = UITool.FindChildNode(TraCanvas, "Normal"); //获得Fixed TraFixed = UITool.FindChildNode(TraCanvas, "Fixed"); //获得PopUp TraPopUp = UITool.FindChildNode(TraCanvas, "PopUp"); //获得UIMask GameObject maskObj = UITool.FindChildNode(TraCanvas, "UIMask").gameObject; UIMaskMgr = new UIMaskMgr(maskObj); //获得工厂 _Factory = new UIFactory(this); //集合分配内存空间 DicAllUIFrm = new Dictionary <string, IUserInterface>(); DicCurShowUIFrm = new Dictionary <string, IUserInterface>(); StackUIFrm = new Stack <IUserInterface>(); LstHideUIFrm = new List <IUserInterface>(); _TmpLstHideUIFrm = new List <IUserInterface>(); //回收 _RecycleTime = 10; _MinHideTime = 5; }
//得到实例 public static UIMaskMgr Instance() { if (_Instance == null) { _Instance = new GameObject("_UIMaskMgr").AddComponent <UIMaskMgr>(); } return(_Instance); }
/// <summary> /// 重新显示状态 /// </summary> public virtual void Redisplay() { gameObject.SetActive(true); //设置模态窗体调用(必须是弹出窗体) if (CurrentUiType.UiWindType == UiWindType.PopUp) { UIMaskMgr.Instance().SetMaskWindow(gameObject, CurrentUiType.UiTransparencyType); } }
/// <summary> /// 隐藏状态 /// </summary> public virtual void Hiding() { gameObject.SetActive(false); //取消模态窗体调用 if (CurrentUiType.UiWindType == UiWindType.PopUp) { UIMaskMgr.Instance().CancelMaskWindow(); } }
/// <summary> /// 页面重新显示 /// </summary> public virtual void ReDisplay() { this.gameObject.SetActive(true); //对于PopUp窗口调用模态窗体 if (_currentUIType.UIForm_Type == UIFormType.Popup) { UIMaskMgr.GetInstance().SetMaskWindow(this.gameObject, _currentUIType.UIForm_LucencyType); } }
/// <summary> /// 页面隐藏(页面不在栈中) /// </summary> public virtual void Hiding() { this.gameObject.SetActive(false); //对于PopUp窗口取消模态窗体 if (_currentUIType.UIForm_Type == UIFormType.Popup) { UIMaskMgr.GetInstance().CancelMaskWindow(); } }
/// <summary> /// 重新显示状态 /// </summary> public virtual void Redisplay() { this.gameObject.SetActive(true); //设置模态窗体调用(必须是弹出窗体) if (_CurrentUIType.UIForms_Type == UIFormType.PopUp) { UIMaskMgr.GetInstance().SetMaskWindow(this.gameObject, _CurrentUIType.UIForm_LucencyType); } }