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
@@ -10,6 +10,12 @@ public class Point2ClickHandler : MonoBehaviour
private MeshRenderer _meshRenderer;
private void OnDisable()
{
StopAllCoroutines();
if (_meshRenderer != null) _meshRenderer.enabled = false;
}
void OnEnable()
{
if (GetComponent<Collider>() == null) gameObject.AddComponent<SphereCollider>().radius = 0.5f;
@@ -92,9 +98,14 @@ public class Point2ClickHandler : MonoBehaviour
}
public void ResetState()
{
ResetState(true);
}
public void ResetState(bool startBlink)
{
_clicked = false;
if (_meshRenderer != null) _meshRenderer.enabled = true;
if (_meshRenderer != null) _meshRenderer.enabled = startBlink;
if (nextObject != null)
{
@@ -113,8 +124,11 @@ public class Point2ClickHandler : MonoBehaviour
}
}
gameObject.SetActive(true);
StopAllCoroutines();
StartCoroutine(BlinkOutline());
gameObject.SetActive(startBlink);
if (startBlink && isActiveAndEnabled)
{
StartCoroutine(BlinkOutline());
}
}
}