private void Check() { //StopCoroutine(Timer(time)); StopAllCoroutines(); cfv.targets.Remove(LaThing); if (objectiveDone) { _phase.GetComponent <FixScript>().Deactivate(this); scoreCounter.AddPoint(3); ObjectIndex = GenerateIndex(); if (objectives.Count - 1 >= ObjectIndex) { StartCoroutine(DoPhase(ObjectIndex)); } else { Debug.LogWarning("ou of range or smg"); } objectiveDone = false; if (audioManager != null) { audioManager.Play("good"); audioManager.Stop("count"); } } else { _phase.GetComponent <FixScript>().Deactivate(this); scoreCounter.RemovePoint(1); ObjectIndex = GenerateIndex(); if (objectives.Count - 1 >= ObjectIndex) { StartCoroutine(DoPhase(ObjectIndex)); } else { Debug.LogWarning("out of range or smg"); } objectiveDone = false; if (audioManager != null) { audioManager.Play("bad"); audioManager.Stop("count"); } } }