Beispiel #1
0
    public void SetHealth()
    {
        switch (health)
        {
        case 3:
            heart1.SetActive(true);
            heart2.SetActive(true);
            heart3.SetActive(true);
            break;

        case 2:
            heart1.SetActive(true);
            heart2.SetActive(true);
            heart3.SetActive(false);
            break;

        case 1:
            heart1.SetActive(true);
            heart2.SetActive(false);
            heart3.SetActive(false);
            break;

        case 0:
            heart1.SetActive(false);
            heart2.SetActive(false);
            heart3.SetActive(false);

            UIScript.GameOver();
            break;
        }
    }