From b35afe1022aa120a3ab717d44009ebb1a3c72dc7 Mon Sep 17 00:00:00 2001 From: yangbear Date: Fri, 10 Jul 2026 23:58:43 +0800 Subject: [PATCH] Hide TipPanel at opening start, show it when opening finishes, and hide it when switching camera --- Assets/Scripts/Animation/OpeningFlowController.cs | 12 ++---------- Assets/Scripts/UI/PageController.cs | 13 ++++++++++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index dd35a62..73b3c4b 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -94,14 +94,14 @@ public class OpeningFlowController : MonoBehaviour { Debug.Log($"[OpeningFlow] PlayOpeningFlow() 被调用, enable={_enableOpeningFlow}"); - // 展示 TipPanel,一直保持到切换 camera2 + // 开场动画开始,隐藏 TipPanel var tipPanel = GameObject.Find("TipPanel"); if (tipPanel == null) { var allT = Resources.FindObjectsOfTypeAll(); foreach(var t in allT) { if (t.name == "TipPanel") { tipPanel = t.gameObject; break; } } } - if (tipPanel != null) tipPanel.SetActive(true); + if (tipPanel != null) tipPanel.SetActive(false); // 再次确保开场隐藏鞋子 var shose = GameObject.Find("Shose"); @@ -177,14 +177,6 @@ public class OpeningFlowController : MonoBehaviour private void SwitchToCamera2() { - var tipPanel = GameObject.Find("TipPanel"); - if (tipPanel == null) - { - var allT = Resources.FindObjectsOfTypeAll(); - foreach(var t in allT) { if (t.name == "TipPanel") { tipPanel = t.gameObject; break; } } - } - if (tipPanel != null) tipPanel.SetActive(false); - var cam2Go = GameObject.Find("camera2"); if (cam2Go != null) { var c = cam2Go.GetComponent(); if (c != null) { c.enabled = true; Debug.Log("[OpeningFlow] camera2 已启用"); } } else Debug.LogWarning("[OpeningFlow] 未找到 camera2"); diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index e38e77c..20c61a2 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -462,9 +462,20 @@ public class PageController : MonoBehaviour Debug.Log($"PageController: 开始等待 {waitTime} 秒以切换摄像机并激活鞋子"); + // --- 开场动画结束,开始显示 TipPanel,直到切换到 camera2 再由切换逻辑隐藏 --- + var tipPanel = GameObject.Find("TipPanel"); + if (tipPanel == null) + { + var allT = Resources.FindObjectsOfTypeAll(); + foreach(var t in allT) { if (t.name == "TipPanel") { tipPanel = t.gameObject; break; } } + } + if (tipPanel != null) tipPanel.SetActive(true); + // --------------------------------------------------------------------- + yield return new WaitForSeconds(waitTime); - // 2. 切换到 camera3 + // 2. 切换到 camera3 (注意原逻辑是切到 camera3,如果说是要在这里隐藏TipPanel) + if (tipPanel != null) tipPanel.SetActive(false); if (am != null) am.SwitchToCamera3(); }