Exemplo n.º 1
0
    public void set_animation(InnerState.Emotion emotion)
    {
        timer = 2.0f;
        switch (emotion)
        {
        case InnerState.Emotion.None:
            emotion_name = "Empty";
            break;

        case InnerState.Emotion.Loved:
            emotion_name = "Love";
            break;

        case InnerState.Emotion.Lonely:
            emotion_name = "Disappointed";
            break;

        case InnerState.Emotion.NotHungry:
            emotion_name = "Happy";
            break;

        case InnerState.Emotion.Hungry:
            emotion_name = "Meat";
            break;
        }
    }
Exemplo n.º 2
0
    private void refresh_emotion(InnerState state, bool forced = false)
    {
        var sorted  = state.get_emotions_sorted_by_intensity();
        var current = sorted.GetEnumerator();

        prev = emotion;
        if (current.MoveNext())
        {
            emotion = current.Current.Value;
            bool changed = prev != emotion;
            if (changed || forced)
            {
                set_animation(emotion);
            }
        }
    }