using System; using UnityEngine; namespace ET { [UIEvent(UIType.UILobby)] public class UILobbyEvent: AUIEvent { public override async ETTask 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 = EntityFactory.CreateWithParent(uiComponent, UIType.UILobby, gameObject); ui.AddComponent(); return ui; } public override void OnRemove(UIComponent uiComponent) { ResourcesComponent.Instance.UnloadBundle(UIType.UILobby.StringToAB()); } } }