1234567891011121314151617181920212223242526272829303132 |
- using System;
- using UnityEngine;
- namespace ET.Client
- {
- [UIEvent(UIType.UIHelp)]
- public class UIHelpEvent: AUIEvent
- {
- public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer, params object[] param)
- {
- try
- {
- await uiComponent.DomainScene().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.GetLayer((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;
- }
- }
- public override void OnRemove(UIComponent uiComponent)
- {
- }
- }
- }
|