Fix ResetState for ShoseClickHandler to properly show outline and reset related objects

This commit is contained in:
yangbear
2026-07-12 06:28:31 +08:00
parent 23dd034f75
commit d3db73d271
@@ -136,8 +136,6 @@ public class ShoseClickHandler : MonoBehaviour
{
touchPoint3.gameObject.SetActive(false);
}
}
// 切换到摄像机3(已由 PageController 开场动画结束时完成,此处不再重复触发)
@@ -158,6 +156,8 @@ public class ShoseClickHandler : MonoBehaviour
public void ResetState()
{
_clicked = false;
// 【关键修复】确保 OutlineMesh 在重新激活时处于开启状态并正常闪烁
if (_outlineMesh != null) _outlineMesh.enabled = true;
if (_hasRecordedInitialTransform)
@@ -175,8 +175,6 @@ public class ShoseClickHandler : MonoBehaviour
uiMgr.HideVideo();
}
// 把 woman 重置(取消蹲下)
var woman = GameObject.Find("woman");
if (woman != null)
@@ -185,12 +183,37 @@ public class ShoseClickHandler : MonoBehaviour
if (anim != null)
{
anim.SetBool("isCrouch", false);
}
// 移回原位?如果最初在某个位置,PageController里有记录。这里只要不穿帮即可
// 还需要把女人放回到 point2 处
var point2 = GameObject.Find("womanPointArray/point2");
if (point2 != null)
{
woman.transform.position = point2.transform.position;
woman.transform.rotation = point2.transform.rotation;
}
}
// 取消男伤员的 CheckFoot 动作
var manInjury = GameObject.Find("manInjury");
if (manInjury != null)
{
var anim = manInjury.GetComponent<Animator>();
if (anim != null)
{
anim.SetBool("CheckFoot", false);
}
}
// 【关键修复】把原本被隐藏的 touchArray/point3 的边框重新显示出来
var touchArray = GameObject.Find("touchArray");
if (touchArray != null)
{
var touchPoint3 = touchArray.transform.Find("point3");
if (touchPoint3 != null)
{
touchPoint3.gameObject.SetActive(true);
}
}
// ----------------------------------------
StopAllCoroutines();
StartCoroutine(BlinkOutline());