UILobbyComponentSystem.cs 808 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. namespace ET
  4. {
  5. [ObjectSystem]
  6. public class UILobbyComponentAwakeSystem: AwakeSystem<UILobbyComponent>
  7. {
  8. public override void Awake(UILobbyComponent self)
  9. {
  10. ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
  11. self.enterMap = rc.Get<GameObject>("EnterMap");
  12. self.enterMap.GetComponent<Button>().onClick.AddListener(() => { self.EnterMap().Coroutine(); });
  13. }
  14. }
  15. public static class UILobbyComponentSystem
  16. {
  17. public static async ETTask EnterMap(this UILobbyComponent self)
  18. {
  19. await EnterMapHelper.EnterMapAsync(self.ZoneScene());
  20. await UIHelper.Remove(self.ZoneScene(), UIType.UILobby);
  21. }
  22. }
  23. }