예제 #1
0
파일: Player.cs 프로젝트: Ysabz/FoodBuddy
    public void DisplayHappyAvatar(bool found)
    {
        if (found)
        {
            if (!healthBar.IsMax())
            {
                currentHealth = currentHealth + 1;
                healthBar.SetHealth(currentHealth);
            }
            if (!XPBar.IsMax())
            {
                currentXP = currentXP + 5;
                XPBar.SetXP(currentXP);
            }

            else
            {
                currentLevel = currentLevel + 1;
                currentXP    = 0;
                XPBar.SetXP(currentXP);
                level.GetComponent <TextMeshProUGUI>().SetText("LVL " + currentLevel);
            }

            happyAvatar.SetActive(true);
            happySound.Play();
        }

        else
        {
            happyAvatar.SetActive(false);
        }
    }