using System; using UnityEngine; namespace ET { [UIEvent(UIType.UILogin)] public class UILoginEvent: AUIEvent { public override async ETTask OnCreate(UIComponent uiComponent, UILayer uiLayer) { await uiComponent.Domain.GetComponent().LoadAsync(UIType.UILogin.StringToAB()); GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin); GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.UILayers[(int)uiLayer]); UI ui = uiComponent.AddChild(UIType.UILogin, gameObject); ui.AddComponent(); return ui; } public override void OnRemove(UIComponent uiComponent) { ResourcesComponent.Instance.UnloadBundle(UIType.UILogin.StringToAB()); } } }