Fix full flow reset cleanup for outlines and residual objects, adjust EndPanel buttons
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user