예제 #1
0
 void Life(GameObject setactive)
 {
     Life1.SetActive(true);
     Life2.SetActive(true);
     Life3.SetActive(true);
     Life4.SetActive(true);
     Life5.SetActive(true);
 }
예제 #2
0
파일: Knight.cs 프로젝트: Shahari93/Poof
    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;
        }
    }