Beispiel #1
0
        public void Load()
        {
            //UiTypes.Clear();
            UIType.AddUITypeComponent();
            uiFactory = new UIFactory();
            //List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();

            //foreach (Type type in types)
            //{
            //	object[] attrs = type.GetCustomAttributes(typeof (UIFactoryAttribute), false);
            //	if (attrs.Length == 0)
            //	{
            //		continue;
            //	}

            //	UIFactoryAttribute attribute = attrs[0] as UIFactoryAttribute;
            //	if (UiTypes.ContainsKey(attribute.Type))
            //	{
            //                 Log.Debug($"已经存在同类UI Factory: {attribute.Type}");
            //		throw new Exception($"已经存在同类UI Factory: {attribute.Type}");
            //	}
            //	object o = Activator.CreateInstance(type);
            //	IUIFactory factory = o as IUIFactory;
            //	if (factory == null)
            //	{
            //		Log.Error($"{o.GetType().FullName} 没有继承 IUIFactory");
            //		continue;
            //	}
            //	this.UiTypes.Add(attribute.Type, factory);
            //}
        }
        public override void Run()
        {
            FUI fUI = UIFactory.CreateFUI(FUIType.UILogin);

            fUI.AddComponent <UILobbyComponent>();
            Game.Scene.GetComponent <FUIComponent>().Add(fUI);
        }
Beispiel #3
0
        public override void Run()
        {
            FUI ui = UIFactory.CreateFUI(FUIType.UIChessStore);

            ui.AddComponent <FUIChessStoreComponent>();
            Game.Scene.GetComponent <FUIComponent>().Add(ui);
        }
Beispiel #4
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);
        }
Beispiel #5
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>());
        }