Refine Shose undo back to initial voice, fix video looping and hiding, make TipPanel persistent during opening

This commit is contained in:
yangbear
2026-07-10 03:50:39 +08:00
parent ec503bd3f1
commit 745b11b7f0
5 changed files with 72 additions and 22 deletions
@@ -131,6 +131,13 @@ public class PingClickHandler : MonoBehaviour
if (finishClip != null) am.PlayVoice(finishClip);
#endif
}
// 隐藏视频面板
var videoController = FindObjectOfType<VideoController>(true);
if (videoController != null)
{
videoController.StopVideo();
}
}
}
}
@@ -171,6 +171,50 @@ public class ShoseClickHandler : MonoBehaviour
if (nextObject != null) nextObject.SetActive(false);
// --- 恢复相机2、隐藏视频并重新播放语音 ---
var videoController = FindObjectOfType<VideoController>(true);
if (videoController != null)
{
videoController.StopVideo();
videoController.gameObject.SetActive(false);
}
var cam2 = GameObject.Find("camera2");
var cam3 = GameObject.Find("camera3");
if (cam2 == null)
{
var allT = Resources.FindObjectsOfTypeAll<Transform>();
foreach(var t in allT) { if (t.name == "camera2") { cam2 = t.gameObject; break; } }
}
if (cam2 != null) { var c = cam2.GetComponent<Camera>(); if (c != null) c.enabled = true; }
if (cam3 != null) { var c = cam3.GetComponent<Camera>(); if (c != null) c.enabled = false; }
var am = FindObjectOfType<AudioManager>();
if (am != null)
{
#if UNITY_EDITOR
var autoClip = UnityEditor.AssetDatabase.LoadAssetAtPath<AudioClip>("Assets/Audio/people/周围环境安全,我是救护志愿者,我可以帮助您吗.mp3");
if (autoClip != null)
{
am.PlayVoice(autoClip);
}
#endif
}
// 把 woman 重置(取消蹲下)
var woman = GameObject.Find("woman");
if (woman != null)
{
var anim = woman.GetComponent<Animator>();
if (anim != null)
{
anim.SetBool("isCrouch", false);
}
// 移回原位?如果最初在某个位置,PageController里有记录。这里只要不穿帮即可
}
// ----------------------------------------
StopAllCoroutines();
StartCoroutine(BlinkOutline());
}