24 lines
903 B
C#
24 lines
903 B
C#
using UnityEngine;
|
|
|
|
namespace ET.Client
|
|
{
|
|
[UIEvent(UIType.UILobby)]
|
|
public class UILobbyEvent: AUIEvent
|
|
{
|
|
public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
|
|
{
|
|
await ETTask.CompletedTask;
|
|
string assetsName = $"Assets/Bundles/UI/Demo/{UIType.UILobby}.prefab";
|
|
GameObject bundleGameObject = await uiComponent.Scene().GetComponent<ResourcesLoaderComponent>().LoadAssetAsync<GameObject>(assetsName);
|
|
GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, uiComponent.UIGlobalComponent.GetLayer((int)uiLayer));
|
|
UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILobby, gameObject);
|
|
|
|
ui.AddComponent<UILobbyComponent>();
|
|
return ui;
|
|
}
|
|
|
|
public override void OnRemove(UIComponent uiComponent)
|
|
{
|
|
}
|
|
}
|
|
} |