Fix ping click handler resetting logic properly dividing phase 1 and phase 2
This commit is contained in:
@@ -99,7 +99,7 @@ public class ChanraoTuibuHandler : MonoBehaviour
|
||||
var smr = GetComponent<SkinnedMeshRenderer>(); if (smr != null) smr.enabled = false;
|
||||
foreach (var r in GetComponentsInChildren<Renderer>(true)) { if (_outlineMesh != null && r == _outlineMesh) continue; r.enabled = false; }
|
||||
if (_outlineMesh != null) _outlineMesh.enabled = true;
|
||||
if (nextObject != null) nextObject.SetActive(false);
|
||||
if (nextObject != null) { nextObject.SetActive(false); var p = nextObject.GetComponent<PingClickHandler>(); if (p != null) p.UndoShow(); }
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(BlinkOutline());
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user