public override async ETTask <UI> OnCreate(UIComponent uiComponent) { await uiComponent.Domain.GetComponent <ResourcesLoaderComponent>().LoadAsync(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); }
public override async ETTask <UI> OnCreate(UIComponent uiComponent) { await ETTask.CompletedTask; ResourcesComponent.Instance.LoadBundle(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); }
public override async ETTask <UI> OnCreate(UIComponent uiComponent, UILayer uiLayer) { await ETTask.CompletedTask; await uiComponent.Domain.GetComponent <ResourcesLoaderComponent>().LoadAsync(UIType.UILobby.StringToAB()); GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset(UIType.UILobby.StringToAB(), UIType.UILobby); GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]); UI ui = uiComponent.AddChild <UI, string, GameObject>(UIType.UILobby, gameObject); ui.AddComponent <UILobbyComponent>(); return(ui); }
public override async ETTask <UI> OnCreate(UIComponent uiComponent) { try { await ETTask.CompletedTask; GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get <GameObject>(UIType.UILoading); GameObject go = UnityEngine.Object.Instantiate(bundleGameObject); go.layer = LayerMask.NameToLayer(LayerNames.UI); UI ui = uiComponent.AddChild <UI, string, GameObject>(UIType.UILoading, go); ui.AddComponent <UILoadingComponent>(); return(ui); } catch (Exception e) { Log.Error(e); return(null); } }
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); } }