From faa14386f527af0088a41b667798cb4e5b672c7d Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Thu, 12 Mar 2026 15:22:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(fix):=20=E8=B0=83=E6=95=B4=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=B0=94=E6=B3=A1=E5=8A=A0=E8=BD=BD=E6=97=B6=E6=9C=BA?= =?UTF-8?q?=E4=B8=8E=E9=94=80=E5=94=AE=E6=80=81=E6=A7=BD=E4=BD=8D=E4=BC=98?= =?UTF-8?q?=E5=85=88=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enter 中先 LoadBubbles 再 SwitchCamera,避免 me: 释放log 时找不到 Player 槽位。 SalesState 中优先使用 salesManager.bubbleSlotGroup,缺失时回退 ScreenSystem。 Made-with: Cursor --- Assets/Scripts/FixSystemNew/FixStateMachine.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/FixSystemNew/FixStateMachine.cs b/Assets/Scripts/FixSystemNew/FixStateMachine.cs index af54f9d54..361af62ff 100644 --- a/Assets/Scripts/FixSystemNew/FixStateMachine.cs +++ b/Assets/Scripts/FixSystemNew/FixStateMachine.cs @@ -122,12 +122,12 @@ namespace AibisDream.FixSystem public IEnumerator Enter() { - // 切换相机 - yield return CameraKit.Instance.SwitchCamera(CameraEnum.Clinic); - // 注册对话气泡 + // 先加载对话气泡,避免 Yarn 对话(如 测试 节点 me: 释放log)在相机切换完成前执行时找不到 Player 槽位 var clinicSystem = FixSystemCenter.SystemDic.Get(); var data = clinicSystem.bubbleSlotGroup.CollectData(); DialogUIManager.Instance.LoadBubbles(data); + // 切换相机 + yield return CameraKit.Instance.SwitchCamera(CameraEnum.Clinic); } public IEnumerator Exit() @@ -799,9 +799,16 @@ namespace AibisDream.FixSystem // FadeOut yield return UIManager.Instance.GetPanel().FadeOutAsync(0.5f); - // 注册对话气泡(与其他 state 一致) + // 销售模块使用自身的气泡槽位;缺失时再回退到 ScreenSystem,避免读到错误的槽位配置 if (salesManager.bubbleSlotGroup != null) { + var data = salesManager.bubbleSlotGroup.CollectData(); + Debug.Log("[SalesState] Loaded bubble slots from SalesManager."); + DialogUIManager.Instance.LoadBubbles(data); + } + else if (screenSystem.BubbleSlotGroup != null) + { + Debug.LogWarning("[SalesState] SalesManager.bubbleSlotGroup is null, fallback to ScreenSystem bubble slots."); var data = screenSystem.BubbleSlotGroup.CollectData(); DialogUIManager.Instance.LoadBubbles(data); }