Ejemplo n.º 1
0
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }

            foreach (FGUIBase 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._DicAllUIForms.Clear();
            this._DicCurrentShowUIForms.Clear();
            this._StaCurrentUIForms.Clear();

            base.Dispose();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 加载核心字段数据
        /// </summary>
        public void Awake()
        {
            Instance = this;

            //加载全局共用包
#if UNITY_EDITOR || UNITY_EDITOR && ILRuntime
            //UIPackage.AddPackage("FGUI/UI_CheckUpdate");
#else
//加载AB包
//UIPackage.AddPackage("FGUI/UICheckUpdate");
#endif

            //GRoot的参数初始化
            GRoot.inst.SetContentScaleFactor(1280, 720, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight);
            //UIConfig.buttonSound = (NAudioClip) UIPackage.GetItemAssetByURL("ui://ASource/buttonclick");
            UIConfig.modalLayerColor = new Color(186f, 85f, 211f, 0.4f);
        }