UILobbyComponentSystem.cs 765 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>().ViewGO.GetComponent<ReferenceCollector>();
  11. self.enterMap = rc.Get<GameObject>("EnterMap");
  12. self.enterMap.GetComponent<Button>().onClick.Add(self.EnterMap);
  13. self.text = rc.Get<GameObject>("Text").GetComponent<Text>();
  14. }
  15. }
  16. public static class UILobbyComponentSystem
  17. {
  18. public static void EnterMap(this UILobbyComponent self)
  19. {
  20. MapHelper.EnterMapAsync("Map").Coroutine();
  21. }
  22. }
  23. }