/// <summary> /// 加载核心字段数据 /// </summary> public void Awake() { Instance = this; _DicAllUIForms = new Dictionary <Type, BaseUIForms>(); _DicCurrentShowUIForms = new Dictionary <Type, BaseUIForms>(); _StaCurrentUIForms = new Stack <BaseUIForms>(); #region Mask逻辑 //得到UI根节点、UI脚本节点 _GoCanvasRoot = GameObject.Find("UIRoot"); //得到“顶层面板”与“遮罩面板” _GoTopPlane = _GoCanvasRoot; _GoMaskPlane = _GoCanvasRoot.transform.Find("PopUp/UIMaskPanels").gameObject; //得到UI摄像机的原始“层深” _UICamear = GameObject.Find("UICamera").GetComponent <Camera>(); //得到普通全屏界面节点、固定界面节点、弹出模式节点、UI脚本节点 _CanTransformNormal = _GoCanvasRoot.transform.Find("Normal"); _CanTransformPopUp = _GoCanvasRoot.transform.Find("PopUp"); if (_UICamear != null) { _OriginalUICameraDepth = _UICamear.depth; } else { Debug.Log(GetType() + "/Start()/_UICamera is Null ,please Check!"); } #endregion }
public override void Dispose() { if (this.IsDisposed) { return; } foreach (BaseUIForms ui in this._DicAllUIForms.Values) { if (ui != null) { if (ui.GObject != null) { ui.GObject.Dispose(); } if (ui.Window != null) { ui.Window.Dispose(); } } } Instance = null; this._DicCurrentShowUIForms.Clear(); this._StaCurrentUIForms.Clear(); base.Dispose(); }
public override void Dispose() { if (this.IsDisposed) { return; } Instance = null; this._DicAllUIForms.Clear(); this._DicCurrentShowUIForms.Clear(); this._StaCurrentUIForms.Clear(); base.Dispose(); }
/// <summary> /// 加载核心字段数据 /// </summary> public void Awake() { Instance = this; _DicAllUIForms = new Dictionary <Type, BaseUIForms>(); _DicCurrentShowUIForms = new Dictionary <Type, BaseUIForms>(); _StaCurrentUIForms = new Stack <BaseUIForms>(); //加载UI包 #if UNITY_EDITOR UIPackage.AddPackage("UI/ASource"); #else //加载AB包 #endif //Groot的参数初始化 GRoot.inst.SetContentScaleFactor(1136, 640, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight); UIConfig.buttonSound = (AudioClip)UIPackage.GetItemAssetByURL("ui://ASource/buttonclick"); UIConfig.modalLayerColor = new Color(186f, 85f, 211f, 0.4f); }