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