12345678910111213141516171819202122232425 |
- using System;
- using UnityEngine;
- namespace ET.Client
- {
- [UIEvent(UIType.UISettle)]
- public class UISettleEvent : AUIEvent
- {
- public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer, params object[] param)
- {
- await ETTask.CompletedTask;
- await uiComponent.DomainScene().GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UISettle.StringToAB());
- GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UISettle.StringToAB(), UIType.UISettle);
- GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.GetLayer((int)uiLayer));
- UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UISettle, gameObject);
- ui.AddComponent<UISettleComponent>(false,param);
- return ui;
- }
- public override void OnRemove(UIComponent uiComponent)
- {
- ResourcesComponent.Instance.UnloadBundle(UIType.UISettle.StringToAB());
- }
- }
- }
|