Fix full flow reset cleanup for outlines and residual objects, adjust EndPanel buttons
This commit is contained in:
@@ -30,7 +30,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
var sc = GetComponent<SphereCollider>(); if(sc != null) sc.enabled = false;
|
||||
var col = GetComponent<BoxCollider>();
|
||||
if (col == null) col = gameObject.AddComponent<BoxCollider>();
|
||||
// Unity 的 BoxCollider.size 处于本地坐标空间,会自动乘上 localScale,这里不能重复缩放
|
||||
col.center = mb.center;
|
||||
col.size = mb.size * 1.2f;
|
||||
col.enabled = true;
|
||||
@@ -104,7 +103,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
anim.CrossFade("womanCrouch", 0.1f);
|
||||
}
|
||||
|
||||
// 移动 woman 到 point3
|
||||
var point3 = GameObject.Find("womanPointArray/point3");
|
||||
if (point3 != null)
|
||||
{
|
||||
@@ -121,13 +119,10 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
{
|
||||
anim.SetBool("CheckFoot", true);
|
||||
anim.CrossFade("manInjuryFoot", 0.1f);
|
||||
|
||||
// 启动协程,在动画播放完后将 CheckFoot 重置为 false
|
||||
StartCoroutine(ResetCheckFoot(anim));
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏 point3 的边框 (touchArray/point3)
|
||||
var touchArray = GameObject.Find("touchArray");
|
||||
if (touchArray != null)
|
||||
{
|
||||
@@ -138,7 +133,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// 显示 VideoPanel 并播放视频
|
||||
var uiMgr = FindObjectOfType<UIManager>();
|
||||
if (uiMgr != null)
|
||||
{
|
||||
@@ -147,11 +141,15 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
}
|
||||
|
||||
public void ResetState()
|
||||
{
|
||||
ResetState(true);
|
||||
}
|
||||
|
||||
public void ResetState(bool startBlink)
|
||||
{
|
||||
_clicked = false;
|
||||
|
||||
// 【关键修复】确保 OutlineMesh 在重新激活时处于开启状态并正常闪烁
|
||||
if (_outlineMesh != null) _outlineMesh.enabled = true;
|
||||
if (_outlineMesh != null) _outlineMesh.enabled = startBlink;
|
||||
|
||||
if (_hasRecordedInitialTransform)
|
||||
{
|
||||
@@ -159,7 +157,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
transform.rotation = _initialRotation;
|
||||
}
|
||||
|
||||
// 返回时要隐藏 ping
|
||||
if (nextObject != null) nextObject.SetActive(false);
|
||||
|
||||
var uiMgr = FindObjectOfType<UIManager>();
|
||||
@@ -168,7 +165,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
uiMgr.HideVideo();
|
||||
}
|
||||
|
||||
// 把 woman 重置(取消蹲下)
|
||||
var woman = GameObject.Find("woman");
|
||||
if (woman != null)
|
||||
{
|
||||
@@ -185,7 +181,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// 取消男伤员的 CheckFoot 动作
|
||||
var manInjury = GameObject.Find("manInjury");
|
||||
if (manInjury != null)
|
||||
{
|
||||
@@ -196,7 +191,6 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// 重新显示 touchArray/point3 的边框
|
||||
var touchArray = GameObject.Find("touchArray");
|
||||
if (touchArray != null)
|
||||
{
|
||||
@@ -208,7 +202,16 @@ public class ShoseClickHandler : MonoBehaviour
|
||||
}
|
||||
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(BlinkOutline());
|
||||
if (startBlink && isActiveAndEnabled)
|
||||
{
|
||||
StartCoroutine(BlinkOutline());
|
||||
}
|
||||
}
|
||||
|
||||
public void ForceHideOutline()
|
||||
{
|
||||
StopAllCoroutines();
|
||||
if (_outlineMesh != null) _outlineMesh.enabled = false;
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator ResetCheckFoot(Animator anim)
|
||||
|
||||
Reference in New Issue
Block a user