public void StopScore() { CancelInvoke("IncrementScore"); //stop score and add to highscore spawner.StopSpawning(); if (PlayerPrefs.HasKey("HighScore")) { if (PlayerPrefs.GetInt("HighScore") < score) { PlayerPrefs.SetInt("HighScore", score); } } else { PlayerPrefs.SetInt("HighScore", score); } highScoreNum.text = PlayerPrefs.GetInt("HighScore") + ""; scoreNum.text = score + ""; gameOverPanel.SetActive(true); }
public void PlayerIsHit() { spawner.StopSpawning(); bossScript.EndInvoke(); gameOverCard.SetActive(true); }