private Emotion FindEmotion(EmotionRef emotion) { foreach (Emotion e in Emotions) { if (e.Name == emotion) { return(e); } } return(null); }
public void AddToValue(EmotionRef emotionName, float amount) { Emotion e = FindEmotion(emotionName); if (e.EmotionValue + (e.Threshold * amount) > 1.0f) { e.EmotionValue = 1.0f; } else { e.EmotionValue += e.Threshold * amount; } }
public float GetEmotionThreshold(EmotionRef emotionName) { return(FindEmotion(emotionName).Threshold); }
public float GetEmotionDecay(EmotionRef emotionName) { return(FindEmotion(emotionName).Decay); }
public float GetEmotionValue(EmotionRef emotionName) { return(FindEmotion(emotionName).EmotionValue); }