增加跳步loading

This commit is contained in:
shenjianxing 2025-01-13 09:39:11 +08:00
parent 019ec34980
commit d69bb45c4d
2 changed files with 11 additions and 1 deletions

View File

@ -155,6 +155,7 @@ public class OperationController : MonoSingleton<OperationController>
} }
} }
} }
TypeEventSystem.Global.Send<OnLoadingShow>();
seq.Start(this, () => seq.Start(this, () =>
{ {
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start); curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
@ -174,6 +175,7 @@ public class OperationController : MonoSingleton<OperationController>
} }
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart }); TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart });
} }
TypeEventSystem.Global.Send<OnLoadingShow>();
seq.Start(this, () => seq.Start(this, () =>
{ {
curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start); curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start);
@ -196,10 +198,12 @@ public class OperationController : MonoSingleton<OperationController>
this.index = targetIndex; this.index = targetIndex;
isStepRun = true; isStepRun = true;
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Start }); TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Start });
TypeEventSystem.Global.Send<OnLoadingHide>();
curAction.Start(this, () => curAction.Start(this, () =>
{ {
isStepRun = false; isStepRun = false;
TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Finished }); TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Finished });
}); });
} }
else else

View File

@ -15,7 +15,13 @@ namespace QFramework.Example
{ {
mData = uiData as UILoadingData ?? new UILoadingData(); mData = uiData as UILoadingData ?? new UILoadingData();
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
TypeEventSystem.Global.Register<OnLoadingShow>(arg => Show()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnLoadingShow>(arg =>
{
if (gameObject.activeSelf == false)
{
Show();
}
}).UnRegisterWhenGameObjectDestroyed(gameObject);
TypeEventSystem.Global.Register<OnLoadingHide>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnLoadingHide>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
} }