コード例 #1
0
ファイル: BaseUIForms.cs プロジェクト: isoundy000/ETGame
        public void Awake()
        {
            if (string.IsNullOrEmpty(this.pakName) || string.IsNullOrEmpty(this.cmpName))
            {
                Log.Error(this.GetType() + "/Awake() 初始化Ui界面失败,pakName或cmpName为空!");
                return;
            }
#if UNITY_EDITOR
            UIPackage.AddPackage("UI/" + pakName);
#endif

            this.GObject = UIPackage.CreateObject(pakName, cmpName);
            if (this.GObject == null)
            {
                Log.Error(this.GetType() + "/Awake() 获取不到Faigui对象!确认项目配置正确后,请检查包名:" + this.pakName + ",组件名:" + this.cmpName);
                return;
            }

            InitUI();

            //弹出窗体
            if (_CurrentUIType.UIForms_Type == UIFormsType.Window)
            {
                this.Window                       = new ExWindow();
                this.Window.contentPane           = this.GObject.asCom;
                this.Window.doShowAnimationEvent += DoShowAnimationEvent;
                this.Window.doHideAnimationEvent += DoHideAnimationEvent;
                this.Window.onHideEvent          += OnHideEvent;
            }
        }
コード例 #2
0
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }

            this.pakName = null;

            this.GObject = null;

            this.Window?.Dispose();
            this.Window = null;

            base.Dispose();
        }
コード例 #3
0
        public virtual void Awake()
        {
            if (string.IsNullOrEmpty(this.pakName))
            {
                Log.Error(this.GetType() + "/Awake() 初始化Ui界面失败,pakName为空!");
                return;
            }

            // 热更层的话, 根据自己需要从AB包中读取
            UIPackage.AddPackage("FGUI/" + pakName);

            //弹出窗体
            if (CurrentUIType.UIForms_Type == UIFormsType.Window)
            {
                this.Window                       = new ExWindow();
                this.Window.contentPane           = this.GObject.asCom;
                this.Window.doShowAnimationEvent += DoShowAnimationEvent;
                this.Window.doHideAnimationEvent += DoHideAnimationEvent;
                this.Window.onHideEvent          += OnHideEvent;
            }
        }