| 12345678910111213141516171819202122232425262728293031323334353637 |
- using UnityEngine;
- using UnityEngine.UI;
- namespace ET
- {
- public class UiLoadingComponentAwakeSystem : AwakeSystem<UILoadingComponent>
- {
- public override void Awake(UILoadingComponent self)
- {
- self.text = self.GetParent<UI>().GameObject.Get<GameObject>("Text").GetComponent<Text>();
- }
- }
- public class UiLoadingComponentStartSystem : StartSystem<UILoadingComponent>
- {
- public override void Start(UILoadingComponent self)
- {
- StartAsync(self).Coroutine();
- }
-
- public async ETVoid StartAsync(UILoadingComponent self)
- {
- TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
- long instanceId = self.InstanceId;
- while (true)
- {
- await timerComponent.WaitAsync(1000);
- if (self.InstanceId != instanceId)
- {
- return;
- }
- }
- }
- }
- }
|