Esempio n. 1
0
        public override void Run()
        {
            Log.Debug("InitSceneStart!!!");
            // 创建ui
            UI ui = UIFactory.Create(DemoUIType.UITest.StringToAB(), DemoUIType.UITest, DemoUIType.UITest);

            ui.AddComponent <UITestComponent>();

            // 添加进ui管理组件
            Game.Scene.GetComponent <UIComponent>().Add(ui);
        }
Esempio n. 2
0
        public static T OpenPanel <T>(string uiName) where T : Component, new()
        {
            if (uiNameList.Contains(uiName))
            {
                return(null);
            }
            uiNameList.Add(uiName);

            UI ui = UIFactory.Create <T>(uiName);

            Game.Scene.GetComponent <UIComponent>().Add(ui);
            return(ui.GetComponent <T>());
        }