From d69bb45c4d3d58f9dd7c621f37770956b2efbc23 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 09:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B7=B3=E6=AD=A5loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Controller/OperationController.cs | 4 ++++ Assets/Scripts/UI/UILoading.cs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Controller/OperationController.cs b/Assets/Scripts/Controller/OperationController.cs index 156f24ad..a9dfa608 100644 --- a/Assets/Scripts/Controller/OperationController.cs +++ b/Assets/Scripts/Controller/OperationController.cs @@ -155,6 +155,7 @@ public class OperationController : MonoSingleton } } } + TypeEventSystem.Global.Send(); seq.Start(this, () => { curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start); @@ -174,6 +175,7 @@ public class OperationController : MonoSingleton } TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = i, status = StepStatus.NoStart }); } + TypeEventSystem.Global.Send(); seq.Start(this, () => { curAction = ActionHelper.GetActionAndSub(steps[targetIndex].Start); @@ -196,10 +198,12 @@ public class OperationController : MonoSingleton this.index = targetIndex; isStepRun = true; TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Start }); + TypeEventSystem.Global.Send(); curAction.Start(this, () => { isStepRun = false; TypeEventSystem.Global.Send(new StepStatusOnChange() { curIndex = targetIndex, status = StepStatus.Finished }); + }); } else diff --git a/Assets/Scripts/UI/UILoading.cs b/Assets/Scripts/UI/UILoading.cs index 6d7ed682..98f63e4f 100644 --- a/Assets/Scripts/UI/UILoading.cs +++ b/Assets/Scripts/UI/UILoading.cs @@ -15,7 +15,13 @@ namespace QFramework.Example { mData = uiData as UILoadingData ?? new UILoadingData(); TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); - TypeEventSystem.Global.Register(arg => Show()).UnRegisterWhenGameObjectDestroyed(gameObject); + TypeEventSystem.Global.Register(arg => + { + if (gameObject.activeSelf == false) + { + Show(); + } + }).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); }