23 lines
884 B
C#

using System;
using UnityEngine;
namespace ET.Client
{
[UIEvent(UIType.UILSRoom)]
public class UILSRoomEvent: AUIEvent
{
public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
{
string assetsName = $"Assets/Bundles/UI/LockStep/{UIType.UILSRoom}.prefab";
GameObject bundleGameObject = await uiComponent.Room().GetComponent<ResourcesLoaderComponent>().LoadAssetAsync<GameObject>(assetsName);
GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, uiComponent.UIGlobalComponent.GetLayer((int)uiLayer));
UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILSRoom, gameObject);
ui.AddComponent<UILSRoomComponent>();
return ui;
}
public override void OnRemove(UIComponent uiComponent)
{
}
}
}