Fix ping click handler resetting logic properly dividing phase 1 and phase 2

This commit is contained in:
yangbear
2026-07-09 18:28:08 +08:00
parent c0edd71a56
commit 243b0f2c29
4 changed files with 63 additions and 13 deletions
+30 -3
View File
@@ -84,11 +84,18 @@ public class PingClickHandler : MonoBehaviour
var allPings = Object.FindObjectsOfType<PingClickHandler>();
foreach (var p in allPings)
{
p.ReEnableBorder();
// 只有未被包扎过的 ping 才能重新亮起边框
if (p._modelShown)
{
p.ReEnableBorder();
}
}
Debug.Log($"[PingClick] {name} 是最后一个 ping,所有边框已重新激活!");
}
Debug.Log($"[PingClick] {name} 模型显示, 激活 {nextPing?.name}");
if (nextPing != null) Debug.Log($"[PingClick] {name} 模型显示, 激活 {nextPing.name}");
else Debug.Log($"[PingClick] {name} 模型显示, 激活下一个");
var sm = FindObjectOfType<StepManager>();
if (sm != null) sm.RecordPingStep(pingIndex, false);
}
@@ -124,7 +131,27 @@ public class PingClickHandler : MonoBehaviour
}
}
public void ReEnableBorder() { _isBlinking = true; if (_outlineMesh != null) { _outlineMesh.enabled = true; StopAllCoroutines(); StartCoroutine(BlinkOutline()); } }
public void ReEnableBorder()
{
// 如果它已经被隐藏(包扎完毕),则不应该重新激活边框!
var col = GetComponent<Collider>();
if (col != null && !col.enabled) return;
_isBlinking = true;
if (_outlineMesh != null)
{
_outlineMesh.enabled = true;
StopAllCoroutines();
StartCoroutine(BlinkOutline());
}
}
public void DisableBorder()
{
_isBlinking = false;
if (_outlineMesh != null) _outlineMesh.enabled = false;
StopAllCoroutines();
}
public void UndoSecondClick()
{