public override void on_update(AnimalShelter shelter, InnerState state) { state.change(InnerState.Emotion.Lonely, 0.01f * Time.deltaTime); state.change(InnerState.Emotion.Loved, -0.01f * Time.deltaTime); refresh_emotion(state); if (state.get(InnerState.Emotion.Lonely) > 0.8f) { shelter.kill(this); } }
private void become_hungry(InnerState state) { state.change(InnerState.Emotion.Hungry, 0.03f * Time.deltaTime); state.change(InnerState.Emotion.NotHungry, -0.03f * Time.deltaTime); }