Beispiel #1
0
    public void DisplaySadAvatar(bool found)
    {
        if (found)
        {
            if (healthBar.IsMin())
            {
                Debug.Log("Robot died");
                currentLevel  = 0;
                currentXP     = 0;
                currentHealth = maxHealth;
                XPBar.SetXP(currentXP);
                healthBar.SetHealth(currentHealth);
                // death
            }
            else
            {
                currentHealth = currentHealth - 1;
                healthBar.SetHealth(currentHealth);
            }
            sadAvatar.SetActive(true);
            sadSound.Play();
        }

        else
        {
            sadAvatar.SetActive(false);
        }
    }