26 lines
853 B
C#
26 lines
853 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace ET.Client
|
|
{
|
|
[EntitySystemOf(typeof(UILobbyComponent))]
|
|
[FriendOf(typeof(UILobbyComponent))]
|
|
public static partial class UILobbyComponentSystem
|
|
{
|
|
[EntitySystem]
|
|
private static void Awake(this UILobbyComponent self)
|
|
{
|
|
ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
|
|
|
|
self.enterMap = rc.Get<GameObject>("EnterMap");
|
|
self.enterMap.GetComponent<Button>().onClick.AddListener(() => { self.EnterMap().Coroutine(); });
|
|
}
|
|
|
|
public static async ETTask EnterMap(this UILobbyComponent self)
|
|
{
|
|
Scene root = self.Root();
|
|
await EnterMapHelper.EnterMapAsync(root);
|
|
await UIHelper.Remove(root, UIType.UILobby);
|
|
}
|
|
}
|
|
} |