UILoadingComponentSystem.cs 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. namespace ET
  4. {
  5. public class UiLoadingComponentAwakeSystem : AwakeSystem<UILoadingComponent>
  6. {
  7. public override void Awake(UILoadingComponent self)
  8. {
  9. self.text = self.GetParent<UI>().GameObject.Get<GameObject>("Text").GetComponent<Text>();
  10. }
  11. }
  12. public class UiLoadingComponentStartSystem : StartSystem<UILoadingComponent>
  13. {
  14. public override void Start(UILoadingComponent self)
  15. {
  16. StartAsync(self).Coroutine();
  17. }
  18. public async ETVoid StartAsync(UILoadingComponent self)
  19. {
  20. long instanceId = self.InstanceId;
  21. while (true)
  22. {
  23. await TimerComponent.Instance.WaitAsync(1000);
  24. if (self.InstanceId != instanceId)
  25. {
  26. return;
  27. }
  28. }
  29. }
  30. }
  31. }