Пример #1
0
 public void OnDeath()
 {
     isDead = true;
     if (PlayerPrefs.GetFloat("Highscore") < score)
     {
         PlayerPrefs.SetFloat("Highscore", score);
     }
     PlayerPrefs.SetFloat("CreditTemp", score);
     deathMenu.ToggleDeathMenu(score);
 }
Пример #2
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Damage")
     {
         health -= 40;
         if (health <= 0)
         {
             death.ToggleDeathMenu();
         }
     }
 }
Пример #3
0
    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);
    }
Пример #4
0
    // 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();
    }
Пример #5
0
 private void OnDeath()
 {
     isDead = true;
     deathMenu.ToggleDeathMenu(keys);
 }
Пример #6
0
 private void OnDeath()
 {
     Debug.Log("End Game Here");
     deathMenu.ToggleDeathMenu();
     vehicle.SetActive(false);
 }
Пример #7
0
 public void OnDeath()
 {
     isDead = true;
     deathMenu.ToggleDeathMenu(score);
 }