Fix full flow reset cleanup for outlines and residual objects, adjust EndPanel buttons

This commit is contained in:
yangbear
2026-07-12 12:17:06 +08:00
parent a6bda2b296
commit e7eb9a9cbc
8 changed files with 312 additions and 66 deletions
+21 -7
View File
@@ -188,9 +188,8 @@ public class PingClickHandler : MonoBehaviour
remaining++;
}
if (remaining <= 1)
if (remaining == 0)
{
// 彻底修复:使用静态标志位锁定播放动作,这一轮绝不会播两次
if (!_hasPlayedFinishVoice)
{
_hasPlayedFinishVoice = true;
@@ -208,7 +207,7 @@ public class PingClickHandler : MonoBehaviour
if (uiMgr != null)
{
uiMgr.HideVideo();
uiMgr.ShowEndPanel(); // 调用显示结束面板
uiMgr.ShowEndPanel();
}
}
}
@@ -250,7 +249,6 @@ public class PingClickHandler : MonoBehaviour
_isBlinking = true;
_enableFrame = Time.frameCount;
// 撤销的时候,把语音锁打开,以便能够重新播放
_hasPlayedFinishVoice = false;
if (_outlineMesh != null) _outlineMesh.enabled = true;
@@ -282,17 +280,33 @@ public class PingClickHandler : MonoBehaviour
}
public void ResetState()
{
ResetState(true);
}
public void ResetState(bool startBlink)
{
_modelShown = false;
_isBlinking = true;
_isBlinking = startBlink;
_enableFrame = Time.frameCount;
_hasPlayedFinishVoice = false;
if (_modelRenderer != null) _modelRenderer.enabled = false;
if (chanraoObject != null) chanraoObject.SetActive(false);
foreach (var r in GetComponentsInChildren<Renderer>(true)) { if (_outlineMesh != null && r == _outlineMesh) continue; r.enabled = false; }
if (_outlineMesh != null) _outlineMesh.enabled = true;
if (_outlineMesh != null) _outlineMesh.enabled = startBlink;
StopAllCoroutines();
StartCoroutine(BlinkOutline());
if (startBlink && isActiveAndEnabled)
{
StartCoroutine(BlinkOutline());
}
}
public void ForceHideOutline()
{
_isBlinking = false;
StopAllCoroutines();
if (_outlineMesh != null) _outlineMesh.enabled = false;
}
}