public void OnDeath() { isDead = true; if (PlayerPrefs.GetFloat("Highscore") < score) { PlayerPrefs.SetFloat("Highscore", score); } PlayerPrefs.SetFloat("CreditTemp", score); deathMenu.ToggleDeathMenu(score); }
void OnCollisionEnter(Collision col) { if (col.gameObject.tag == "Damage") { health -= 40; if (health <= 0) { death.ToggleDeathMenu(); } } }
public void OnDeath() { isDead = true; if (PlayerPrefs.GetFloat("Highscore" + currentScene.name) < score) { PlayerPrefs.SetFloat("Highscore" + currentScene.name, score); } eggsToAdd = PlayerPrefs.GetInt("NumEggs"); eggsToAdd += eggs; PlayerPrefs.SetInt("NumEggs", eggsToAdd); deathMenu.ToggleDeathMenu(score); }
// Update is called once per frame void Update() { if (gm.isDead) { deathMenu.ToggleDeathMenu(); return; } if (gm.score >= scoreToNextLevel) { LevelUp(); } gm.score += Time.deltaTime * difficulty; score.text = ((int)gm.score).ToString(); lives.text = "Lives: " + ((int)gm.lives).ToString(); }
private void OnDeath() { isDead = true; deathMenu.ToggleDeathMenu(keys); }
private void OnDeath() { Debug.Log("End Game Here"); deathMenu.ToggleDeathMenu(); vehicle.SetActive(false); }
public void OnDeath() { isDead = true; deathMenu.ToggleDeathMenu(score); }