コード例 #1
0
ファイル: UILoginEvent.cs プロジェクト: chanayy123/ET
        public override async ETTask <UI> OnCreate(UIComponent uiComponent)
        {
            await ResourcesComponent.Instance.LoadBundleAsync(UIType.UILogin.StringToAB());

            GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin);
            GameObject gameObject       = UnityEngine.Object.Instantiate(bundleGameObject);

            UI ui = uiComponent.AddChild <UI, string, GameObject>(UIType.UILogin, gameObject);

            ui.AddComponent <UILoginComponent>();
            return(ui);
        }
コード例 #2
0
ファイル: UILobbyEvent.cs プロジェクト: aegeanzks/ET
        public override async ETTask <UI> OnCreate(UIComponent uiComponent)
        {
            await ETTask.CompletedTask;
            await uiComponent.Parent.GetComponent <ResourcesLoaderComponent>().LoadAsync(UIType.UILobby.StringToAB());

            GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset(UIType.UILobby.StringToAB(), UIType.UILobby);
            GameObject gameObject       = UnityEngine.Object.Instantiate(bundleGameObject);
            UI         ui = uiComponent.AddChild <UI, string, GameObject>(UIType.UILobby, gameObject);

            ui.AddComponent <UILobbyComponent>();
            return(ui);
        }
コード例 #3
0
        public override async ETTask <UI> OnCreate(UIComponent uiComponent)
        {
            ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>();
            await resourcesComponent.LoadBundleAsync(UIType.UILogin.StringToAB());

            GameObject bundleGameObject = (GameObject)resourcesComponent.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin);
            GameObject gameObject       = UnityEngine.Object.Instantiate(bundleGameObject);

            UI ui = EntityFactory.Create <UI, string, GameObject>(uiComponent.Domain, UIType.UILogin, gameObject);

            ui.AddComponent <UILoginComponent>();
            return(ui);
        }
コード例 #4
0
        public override async ETTask <UI> OnCreate(UIComponent uiComponent)
        {
            await ETTask.CompletedTask;

            ResourcesComponent.Instance.LoadBundle(UIType.UILogin.StringToAB());

            UnityEngine.Object bundleGameObject = ResourcesComponent.Instance.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin);

            GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject) as GameObject;

            UI ui = EntityFactory.CreateWithParent <UI, string, GameObject>(uiComponent, UIType.UILogin, gameObject);

            ui.AddComponent <UILoginComponent>();

            return(ui);
        }
コード例 #5
0
        public override async ETTask <UI> OnCreate(UIComponent uiComponent)
        {
            try
            {
                GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get <GameObject>(UIType.UILoading);
                GameObject go = UnityEngine.Object.Instantiate(bundleGameObject);
                go.layer = LayerMask.NameToLayer(LayerNames.UI);
                UI ui = EntityFactory.Create <UI, string, GameObject>(uiComponent.Domain, UIType.UILoading, go);

                ui.AddComponent <UILoadingComponent>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }
コード例 #6
0
        public static UI Create()
        {
            try
            {
                ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>();
                resourcesComponent.LoadBundle(UIType.UILobby.StringToAB());
                GameObject bundleGameObject = (GameObject)resourcesComponent.GetAsset(UIType.UILobby.StringToAB(), UIType.UILobby);
                GameObject gameObject       = UnityEngine.Object.Instantiate(bundleGameObject);
                UI         ui = EntityFactory.Create <UI, string, GameObject>(Game.Scene, UIType.UILobby, gameObject);

                ui.AddComponent <UILobbyComponent>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }
コード例 #7
0
        public override async ETTask <UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
        {
            try
            {
                await uiComponent.Domain.GetComponent <ResourcesLoaderComponent>().LoadAsync(UIType.UIHelp.StringToAB());

                GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset(UIType.UIHelp.StringToAB(), UIType.UIHelp);
                GameObject gameObject       = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]);
                UI         ui = uiComponent.AddChild <UI, string, GameObject>(UIType.UIHelp, gameObject);

                ui.AddComponent <UIHelpComponent>();
                return(ui);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(null);
            }
        }