Beispiel #1
0
        private void btn_01()
        {
            Debug.Log("Flux demo1-0,点击这里追踪代码!");

            //可以F12查看Test01Component的代码
            var com = new Component_Test001();

            //这里是同步加载
            if (com.IsLoad)
            {
                com.Transform.SetParent(this.Transform, false);
                com.Open();
            }
            else
            {
                com.AsyncLoad(() => { BDebug.Log("加载完成"); });
            }
        }
Beispiel #2
0
        public override void Init()
        {
            base.Init();
            //
            btn_close.onClick.AddListener((() =>
            {
                this.Close();
            }));
            //测试Component同步加载
            btn_01.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo1,点击这里追踪代码!");

                //可以F12查看Test01Component的代码
                var com = new Component_Test001();
                //这里是同步加载
                if (com.IsLoad)
                {
                    com.Transform.SetParent(this.Transform, false);
                    com.Open();
                }
            });

            //demo2.窗口和自定义组件赋值
            btn_02.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo2,点击这里追踪代码!");
                UIManager.Inst.LoadWindow(WinEnum.Win_Demo6_Test002);
                UIManager.Inst.ShowWindow(WinEnum.Win_Demo6_Test002);
            });
            //3.自定义逻辑注册
            btn_03.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo3,点击这里追踪代码!");
                UIManager.Inst.LoadWindow(WinEnum.Win_Demo6_Test003);
                UIManager.Inst.ShowWindow(WinEnum.Win_Demo6_Test003);
            });
            //4.窗口,子窗口
            btn_04.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo4,点击这里追踪代码!");
                UIManager.Inst.LoadWindow(WinEnum.Win_Demo6_Test004);
                UIManager.Inst.ShowWindow(WinEnum.Win_Demo6_Test004);
            });

            //5.普通窗口 Props
            btn_05.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo5,点击这里追踪代码!");
                UIManager.Inst.LoadWindow(WinEnum.Win_Demo6_Test005);
                UIManager.Inst.ShowWindow(WinEnum.Win_Demo6_Test005);
            });

            //6.普通窗口 reducer
            btn_06.onClick.AddListener(() =>
            {
                Debug.Log("Flux demo6,点击这里追踪代码!");
                UIManager.Inst.LoadWindow(WinEnum.Win_Demo6_Test006);
                UIManager.Inst.ShowWindow(WinEnum.Win_Demo6_Test006);
            });
        }