diff --git a/Assets/Scripts/Core/UndoManager.cs b/Assets/Scripts/Core/UndoManager.cs index 8be0adc..0d9ac55 100644 --- a/Assets/Scripts/Core/UndoManager.cs +++ b/Assets/Scripts/Core/UndoManager.cs @@ -61,35 +61,6 @@ public static class ActionHistory return true; } - else if (item.Type == ActionType.PingFirst) - { - // 如果在定位(第一阶段),则重置所有的定位,退回到只有第一个点发光的状态 - while (History.Count > 0 && History.Peek().Type == ActionType.PingFirst) - { - History.Pop(); - } - - var allPings = Object.FindObjectsOfType(true); - foreach (var p in allPings) - { - if (p.chanraoObject != null) p.chanraoObject.SetActive(false); - - if (p.pingIndex == 0) - { - p.gameObject.SetActive(true); - p.ResetState(); - } - else - { - p.UndoShow(); - } - } - - var sm = Object.FindObjectOfType(); - if (sm != null) sm.SetPingStepIndex(0); - - return true; - } if (item.Type == ActionType.Shose) { diff --git a/Assets/Scripts/Interaction/PingClickHandler.cs b/Assets/Scripts/Interaction/PingClickHandler.cs index 2f81191..164c688 100644 --- a/Assets/Scripts/Interaction/PingClickHandler.cs +++ b/Assets/Scripts/Interaction/PingClickHandler.cs @@ -16,6 +16,8 @@ public class PingClickHandler : MonoBehaviour if (_modelRenderer == null) _modelRenderer = GetComponentInChildren(); foreach (var r in GetComponentsInChildren(true)) r.enabled = false; if (GetComponent() == null) gameObject.AddComponent().radius = 0.5f; + var col = GetComponent(); + if (col != null) col.enabled = true; CreateOutlineMesh(); _modelShown = false; _isBlinking = true; @@ -163,7 +165,16 @@ public class PingClickHandler : MonoBehaviour StopAllCoroutines(); StartCoroutine(BlinkOutline()); } - public void UndoShow() { HideSelf(); } + public void UndoShow() + { + _modelShown = false; + _isBlinking = false; + StopAllCoroutines(); + if (chanraoObject != null) chanraoObject.SetActive(false); + foreach (var r in GetComponentsInChildren(true)) r.enabled = false; + var col = GetComponent(); if (col != null) col.enabled = false; + gameObject.SetActive(false); + } private void HideSelf() { @@ -183,6 +194,8 @@ public class PingClickHandler : MonoBehaviour public void ResetState() { _modelShown = false; + var col = GetComponent(); + if (col != null) col.enabled = true; _isBlinking = true; if (_modelRenderer != null) _modelRenderer.enabled = false; // 隐藏自身模型 diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index 0bb117f..e99b343 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -432,7 +432,6 @@ public class PageController : MonoBehaviour } h.nextObject = chanraotuibu; } - shose.SetActive(false); shose.SetActive(true); Debug.Log("PageController: 开场动画结束,Shose 已立刻激活"); }