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