void Life(GameObject setactive)
 {
     Life1.SetActive(true);
     Life2.SetActive(true);
     Life3.SetActive(true);
     Life4.SetActive(true);
     Life5.SetActive(true);
 }
Exemple #2
0
    void Life(int lifeLeft)
    {
        switch (lifeLeft)
        {
        case 5:
            Life1.SetActive(true);
            Life2.SetActive(true);
            Life3.SetActive(true);
            Life4.SetActive(true);
            Life5.SetActive(true);
            break;

        case 4:
            Life1.SetActive(true);
            Life2.SetActive(true);
            Life3.SetActive(true);
            Life4.SetActive(true);
            Life5.SetActive(false);
            break;

        case 3:
            Life1.SetActive(true);
            Life2.SetActive(true);
            Life3.SetActive(true);
            Life4.SetActive(false);
            Life5.SetActive(false);
            break;

        case 2:
            Life1.SetActive(true);
            Life2.SetActive(true);
            Life3.SetActive(false);
            Life4.SetActive(false);
            Life5.SetActive(false);
            break;

        case 1:
            Life1.SetActive(true);
            Life2.SetActive(false);
            Life3.SetActive(false);
            Life4.SetActive(false);
            Life5.SetActive(false);
            break;

        case 0:
            Life1.SetActive(false);
            Life2.SetActive(false);
            Life3.SetActive(false);
            Life4.SetActive(false);
            Life5.SetActive(false);
            break;
        }
    }