Esempio n. 1
0
    public override void on_start(InnerState state)
    {
        anim = GetComponent <Animator>();

        state.set(InnerState.Emotion.Hungry, 0.0f);
        state.set(InnerState.Emotion.NotHungry, 1.0f);
    }
Esempio n. 2
0
    public override void on_update(AnimalShelter shelter, InnerState state)
    {
        become_hungry(state);

        if (state.get(InnerState.Emotion.Hungry) > 0.9f) // Replace lonely with hunger
        {
            if (try_eat_neighbour(shelter, state))
            {
                state.set(InnerState.Emotion.Hungry, 0.0f);
                state.set(InnerState.Emotion.NotHungry, 1.0f);
            }
        }

        refresh_emotion(state);
    }
Esempio n. 3
0
    public override void on_start(InnerState state)
    {
        anim = GetComponent <Animator>();

        state.set(InnerState.Emotion.Loved, 0.5f);
    }