IEnumerator PlayDeadAnimation() { _deadPlaying = true; GetComponent <Animator>().SetBool("Die", true); yield return(new WaitForSeconds(1)); GetComponent <Animator>().SetBool("Die", false); _deadPlaying = false; if (GameManager.lives <= 0) { //GameOver Debug.Log("Treshold for High Score: " + GameManager.hightScore); GameObject[] scEnd = GameObject.FindGameObjectsWithTag("ScoreEnd"); foreach (var txt in scEnd) { txt.GetComponent <Text>().text = GameManager.score.ToString(); } if (GameManager.score >= GameManager.hightScore) { GUINav.getScoresMenu(); } else { GUINav.H_ShowGameOverScreen(); } } else { GM.ResetScene(); } }
IEnumerator PlayDeadAnimation() { _deadPlaying = true; background.Stop(); audio.PlayOneShot(death, 0.45f); GetComponent <Animator>().SetBool("Die", true); yield return(new WaitForSeconds(1)); GetComponent <Animator>().SetBool("Die", false); _deadPlaying = false; if (GameManager.lives <= 0) { Debug.Log("Treshold for High Score: " + SM.LowestHigh()); if (GameManager.score >= SM.LowestHigh()) { GUINav.getScoresMenu(); Debug.Log("GetScoresMenu"); } else { GUINav.H_ShowGameOverScreen(); Debug.Log("Game Over"); } } else { GM.ResetScene(); } }
IEnumerator PlayDeadAnimation() { _deadPlaying = true; nextStep = "n"; previousStep = "n"; prePreviousStep = "n"; GetComponent <Animator>().SetBool("Die", true); yield return(new WaitForSeconds(1)); GetComponent <Animator>().SetBool("Die", false); if (GameManager.lives <= 0) { UnityEngine.Debug.Log("Treshold for High Score: " + SM.LowestHigh()); if (GameManager.score >= SM.LowestHigh()) { GUINav.getScoresMenu(); } else { GUINav.H_ShowGameOverScreen(); } } else { GM.ResetScene(); } _deadPlaying = false; }