Example #1
0
        public void Awake()
        {
            if (string.IsNullOrEmpty(this.pakName) || string.IsNullOrEmpty(this.cmpName))
            {
                Log.Error(this.GetType() + "/Awake() 初始化Ui界面失败,pakName或cmpName为空!");
                return;
            }
#if 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;
            }
        }
Example #2
0
        public virtual void Awake()
        {
            if (string.IsNullOrEmpty(this.pakName))
            {
                Log.Error(this.GetType() + "/Awake() 初始化Ui界面失败,pakName为空!");
                return;
            }

            // 热更层的话, 根据自己需要从AB包中读取
#if UNITY_EDITOR || UNITY_EDITOR && ILRuntime
            UIPackage.AddPackage("Assets/Res/FGUI/" + folderName + "/" + pakName);
#else
            // 读取AssetBundle
            //UIPackage.AddPackage("FGUI/" + pakName);
#endif

            //弹出窗体
            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;
            }
        }
Example #3
0
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }

            this.folderName = null;
            this.pakName    = null;

            this.GObject = null;

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

            base.Dispose();
        }
Example #4
0
 private void Expression_Clicked(object sender, RoutedEventArgs e)
 {
     ExWindow.Show();
     ExWindow.DataContext = ClassInit.ChoicAct.ControlInfo;
 }