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