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

This commit is contained in:
yangbear
2026-07-11 05:15:23 +08:00
parent 4168def501
commit d32a524308
3 changed files with 25 additions and 27 deletions
@@ -72,7 +72,12 @@ public class Point2ClickHandler : MonoBehaviour
}
}
if (nextObject != null) nextObject.SetActive(true);
if (nextObject != null)
{
var shoseHandler = nextObject.GetComponent<ShoseClickHandler>();
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<ShoseClickHandler>();
if (shoseHandler != null) shoseHandler.enabled = false;
else nextObject.SetActive(false);
}
var woman = GameObject.Find("woman");
if (woman != null)
@@ -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<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");