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); }
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>()); }