UILobbyComponentSystem.cs 777 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. namespace ET
  4. {
  5. public class UILobbyComponentAwakeSystem : AwakeSystem<UILobbyComponent>
  6. {
  7. public override void Awake(UILobbyComponent self)
  8. {
  9. ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
  10. self.enterMap = rc.Get<GameObject>("EnterMap");
  11. self.enterMap.GetComponent<Button>().onClick.AddListener(self.EnterMap);
  12. self.text = rc.Get<GameObject>("Text").GetComponent<Text>();
  13. }
  14. }
  15. public static class UILobbyComponentSystem
  16. {
  17. public static void EnterMap(this UILobbyComponent self)
  18. {
  19. MapHelper.EnterMapAsync(self.ZoneScene(), "Map").Coroutine();
  20. }
  21. }
  22. }