From d32a5243086a1da2dbd0c0b05cfd70c3d33aee94 Mon Sep 17 00:00:00 2001 From: yangbear Date: Sat, 11 Jul 2026 05:15:23 +0800 Subject: [PATCH] Fix Point2 outline visual script bug, show Shose without outline at start, only show point2 after camera3 switches, and fix Shose undo removing camera reversion --- .../Scripts/Interaction/Point2ClickHandler.cs | 14 ++++++++++-- .../Scripts/Interaction/ShoseClickHandler.cs | 22 +------------------ Assets/Scripts/UI/PageController.cs | 16 ++++++++++---- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Assets/Scripts/Interaction/Point2ClickHandler.cs b/Assets/Scripts/Interaction/Point2ClickHandler.cs index 8d8f84c..1ed3015 100644 --- a/Assets/Scripts/Interaction/Point2ClickHandler.cs +++ b/Assets/Scripts/Interaction/Point2ClickHandler.cs @@ -72,7 +72,12 @@ public class Point2ClickHandler : MonoBehaviour } } - if (nextObject != null) nextObject.SetActive(true); + if (nextObject != null) + { + var shoseHandler = nextObject.GetComponent(); + if (shoseHandler != null) shoseHandler.enabled = true; + else nextObject.SetActive(true); + } gameObject.SetActive(false); } @@ -81,7 +86,12 @@ public class Point2ClickHandler : MonoBehaviour _clicked = false; if (_meshRenderer != null) _meshRenderer.enabled = true; - if (nextObject != null) nextObject.SetActive(false); + if (nextObject != null) + { + var shoseHandler = nextObject.GetComponent(); + if (shoseHandler != null) shoseHandler.enabled = false; + else nextObject.SetActive(false); + } var woman = GameObject.Find("woman"); if (woman != null) diff --git a/Assets/Scripts/Interaction/ShoseClickHandler.cs b/Assets/Scripts/Interaction/ShoseClickHandler.cs index 5441274..1966d69 100644 --- a/Assets/Scripts/Interaction/ShoseClickHandler.cs +++ b/Assets/Scripts/Interaction/ShoseClickHandler.cs @@ -177,27 +177,7 @@ public class ShoseClickHandler : MonoBehaviour uiMgr.HideVideo(); } - var cam2 = GameObject.Find("camera2"); - var cam3 = GameObject.Find("camera3"); - if (cam2 == null) - { - var allT = Resources.FindObjectsOfTypeAll(); - foreach(var t in allT) { if (t.name == "camera2") { cam2 = t.gameObject; break; } } - } - if (cam2 != null) { var c = cam2.GetComponent(); if (c != null) c.enabled = true; } - if (cam3 != null) { var c = cam3.GetComponent(); if (c != null) c.enabled = false; } - - var am = FindObjectOfType(); - if (am != null) - { -#if UNITY_EDITOR - var autoClip = UnityEditor.AssetDatabase.LoadAssetAtPath("Assets/Audio/people/周围环境安全,我是救护志愿者,我可以帮助您吗.mp3"); - if (autoClip != null) - { - am.PlayVoice(autoClip); - } -#endif - } + // 把 woman 重置(取消蹲下) var woman = GameObject.Find("woman"); diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index 4d0677b..8c7fb3d 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -454,7 +454,9 @@ public class PageController : MonoBehaviour } h.nextObject = chanraotuibu; } - shose.SetActive(false); // 确保一开始隐藏 + // 确保一开始鞋子模型可见,但不闪烁且不可点击 + shose.SetActive(true); + h.enabled = false; } if (point2 != null) @@ -466,8 +468,7 @@ public class PageController : MonoBehaviour if (h2 == null) h2 = point2.AddComponent(); if (h2.nextObject == null) h2.nextObject = shose; - point2.SetActive(true); - Debug.Log("PageController: 开场动画结束,point2 已立刻激活"); + point2.SetActive(false); } // 1. 强制播放第一句语音:“周围环境安全,我是救护志愿者,我可以帮助您吗” @@ -497,9 +498,16 @@ public class PageController : MonoBehaviour yield return new WaitForSeconds(waitTime); - // 2. 切换到 camera3 (注意原逻辑是切到 camera3,如果说是要在这里隐藏TipPanel) + // 2. 切换到 camera3 if (tipPanel != null) tipPanel.SetActive(false); if (am != null) am.SwitchToCamera3(); + + // 3. 切换相机后,显示 point2 + if (point2 != null) + { + point2.SetActive(true); + Debug.Log("PageController: 镜头切换到camera3,point2 已显示"); + } } private void HideShose()