Beispiel #1
0
        public override async ETTask <UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
        {
            await uiComponent.DomainScene().GetComponent <ResourcesLoaderComponent>().LoadAsync(UIType.UILogin.StringToAB());

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

            ui.AddComponent <UILoginComponent>();
            return(ui);
        }
Beispiel #2
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.GetLayer((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);
            }
        }