Hide TipPanel at opening start, show it when opening finishes, and hide it when switching camera

This commit is contained in:
yangbear
2026-07-10 23:58:43 +08:00
parent fec97295be
commit b35afe1022
2 changed files with 14 additions and 11 deletions
@@ -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<Transform>();
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<Transform>();
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<Camera>(); if (c != null) { c.enabled = true; Debug.Log("[OpeningFlow] camera2 已启用"); } }
else Debug.LogWarning("[OpeningFlow] 未找到 camera2");