From d316922b3aaaca4642c4e28114f26d1c31662391 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Sat, 18 Jul 2026 23:59:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(fix-system):=20=E4=BF=AE=E5=A4=8D=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E4=B8=AD=E5=BF=83=E9=94=80=E6=AF=81=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E6=B8=85=E7=90=86=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FixSystemCenter.OnSingletonDestroy 在场景销毁阶段访问的 CameraKit、 BubbleSlotKit 可能已清理,且 Director.QuitCurrentMode 协程依赖的 对象可能已拆除。改为判空访问,并新增 Director.Reset 直接清理状态。 --- Assets/Scripts/FixSystemNew/FixSceneDirector.cs | 13 +++++++++++++ Assets/Scripts/FixSystemNew/FixSystemCenter.cs | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/FixSystemNew/FixSceneDirector.cs b/Assets/Scripts/FixSystemNew/FixSceneDirector.cs index 2b052e274..91ed28650 100644 --- a/Assets/Scripts/FixSystemNew/FixSceneDirector.cs +++ b/Assets/Scripts/FixSystemNew/FixSceneDirector.cs @@ -47,6 +47,19 @@ namespace AibisDream.FixSystem IsTransitioning = false; } + /// + /// Clears director state without running cue exits. Used while the owning scene is + /// being destroyed, when cue dependencies may already have been torn down. + /// + public void Reset() + { + CurrentArgs = ""; + _currentCue = null; + CurrentMode = FixSceneMode.Default; + HasMode = false; + IsTransitioning = false; + } + private IEnumerator TransitionInternal(FixSceneMode nextMode, string args, FixTransitionMode mode) { if (IsTransitioning && mode == FixTransitionMode.Animated) diff --git a/Assets/Scripts/FixSystemNew/FixSystemCenter.cs b/Assets/Scripts/FixSystemNew/FixSystemCenter.cs index 484005444..0f545579c 100644 --- a/Assets/Scripts/FixSystemNew/FixSystemCenter.cs +++ b/Assets/Scripts/FixSystemNew/FixSystemCenter.cs @@ -50,9 +50,9 @@ namespace AibisDream.FixSystem public override void OnSingletonDestroy() { IsDirectorReady = false; - CameraKit.Instance.RemoveAllCam(); - BubbleSlotKit.Instance.RemoveAll(); - GameManager.Instance.StartCoroutine(Director.QuitCurrentMode()); + CameraKit.Instance?.RemoveAllCam(); + BubbleSlotKit.Instance?.RemoveAll(); + Director?.Reset(); Context?.Clear(); }