Esempio n. 1
0
    private void OnChangeHunger(CharacterHungerState oldHunger, CharacterHungerState newHunger)
    {
        switch (newHunger)
        {
        case CharacterHungerState.FULL:
            bellyRenderer.sprite = fullBelly;
            break;

        case CharacterHungerState.NORMAL:
            bellyRenderer.sprite = normalBelly;
            break;

        case CharacterHungerState.STARVING:
            bellyRenderer.sprite = hungryBelly;
            break;

        default:
            Debug.LogError($"{newHunger} hunger state not handled");
            break;
        }
    }
Esempio n. 2
0
 internal void FireChangeHungerStateEvent(CharacterHungerState currentHungerState, CharacterHungerState newHungerState)
 {
     ChangeHungerStateEvent?.Invoke(currentHungerState, newHungerState);
 }