using System; using UnityEngine; namespace ET { [UIEvent(UIType.UILoading)] public class UILoadingEvent: AUIEvent { public override async ETTask OnCreate(UIComponent uiComponent, UILayer uiLayer) { try { await ETTask.CompletedTask; GameObject bundleGameObject = ((GameObject)Resources.Load("KV")).Get(UIType.UILoading); GameObject go = UnityEngine.Object.Instantiate(bundleGameObject); go.layer = LayerMask.NameToLayer(LayerNames.UI); UI ui = uiComponent.AddChild(UIType.UILoading, go); ui.AddComponent(); return ui; } catch (Exception e) { Log.Error(e); return null; } } public override void OnRemove(UIComponent uiComponent) { } } }