public void AlertAction(string action) { ended = true; if (action == "complete") { AudioSource.PlayClipAtPoint(completeSound, transform.position); TextInstance.AlertText("complete"); } else { TextInstance.AlertText("gameover"); } NeuroskyInstance.Disconnect(); bg.GetComponent <AudioSource>().Stop(); Destroy(gameObject, 0.626f); //Invoke("restart", 2); }