/// <summary> /// This function takes in a parameter of emotion /// and then depending on the emotion that is passed in /// changes the material of the object to the corresponding color... /// </summary> private void ColorChange(Globals.EMOTIONS e) { switch (e) { case Globals.EMOTIONS.ANGER: GetComponent <Renderer>().material = mAnger; break; case Globals.EMOTIONS.BOREDOM: GetComponent <Renderer>().material = MBoredom; break; case Globals.EMOTIONS.CONFIDENT: GetComponent <Renderer>().material = mConfident; break; case Globals.EMOTIONS.DISAPPOINTMENT: GetComponent <Renderer>().material = mDisappointment; break; case Globals.EMOTIONS.EMBARRASSED: GetComponent <Renderer>().material = mEmbarrassed; break; case Globals.EMOTIONS.ENERGIZED: GetComponent <Renderer>().material = mEnergized; break; case Globals.EMOTIONS.ENTERTAINED: GetComponent <Renderer>().material = mEntertained; break; case Globals.EMOTIONS.FEAR: GetComponent <Renderer>().material.color = mFear.color; break; case Globals.EMOTIONS.HAPPY: GetComponent <Renderer>().material = mHappy; break; case Globals.EMOTIONS.SAD: GetComponent <Renderer>().material = mSad; break; case Globals.EMOTIONS.SURPRISED: GetComponent <Renderer>().material = mSurprised; break; case Globals.EMOTIONS.TIRED: GetComponent <Renderer>().material = mTired; break; default: GetComponent <Renderer>().material = mSociopath; break; } }
/// <summary> /// This function is lengthy, and will almost certainly /// be changed. this is to prove the concept and get things running. /// </summary> private void CheckEmotionalState() { int v = GetDominateEmotion(); //check if the highest value equals one of your emotions, if it does, then we check //to see if the scale is greater than zero, if it is, then we set the emotion respectfully... if (v == happinessScale) { emotionState = happinessScale >= 0 ? Globals.EMOTIONS.HAPPY : Globals.EMOTIONS.SAD; } else if (v == angerScale) { emotionState = angerScale >= 0 ? Globals.EMOTIONS.ANGER : Globals.EMOTIONS.FEAR; } else if (v == energyScale) { emotionState = energyScale >= 0 ? Globals.EMOTIONS.ENERGIZED : Globals.EMOTIONS.TIRED; } else if (v == interestScale) { emotionState = interestScale >= 0 ? Globals.EMOTIONS.SURPRISED : Globals.EMOTIONS.DISAPPOINTMENT; } else if (v == confidenceScale) { emotionState = confidenceScale >= 0 ? Globals.EMOTIONS.CONFIDENT : Globals.EMOTIONS.EMBARRASSED; } else if (v == entertainmentScale) { emotionState = entertainmentScale >= 0 ? Globals.EMOTIONS.ENTERTAINED : Globals.EMOTIONS.BOREDOM; } //call the color change event... colorMaster.EventColorChange(emotionState); }
/// <summary> /// This function currently handles all our emotion changing /// this will likely be changed into an event that is broken up /// to improve its function.. /// </summary> public void ModifyEmotion(Globals.EMOTIONS emotion, float transferenceValue) { switch (emotion) { // happiness Scale case Globals.EMOTIONS.HAPPY: eScript.happinessScale = Transference(eScript.happinessScale, (int)transferenceValue); break; case Globals.EMOTIONS.SAD: eScript.happinessScale = Transference(eScript.happinessScale, -(int)transferenceValue); break; // anger scale case Globals.EMOTIONS.ANGER: eScript.angerScale = Transference(eScript.angerScale, (int)transferenceValue); break; case Globals.EMOTIONS.FEAR: eScript.angerScale = Transference(eScript.angerScale, -(int)transferenceValue); break; // energy scale case Globals.EMOTIONS.ENERGIZED: eScript.energyScale = Transference(eScript.energyScale, (int)transferenceValue); break; case Globals.EMOTIONS.TIRED: eScript.energyScale = Transference(eScript.energyScale, -(int)transferenceValue); break; // confidence scale case Globals.EMOTIONS.CONFIDENT: eScript.confidenceScale = Transference(eScript.confidenceScale, (int)transferenceValue); break; case Globals.EMOTIONS.EMBARRASSED: eScript.confidenceScale = Transference(eScript.confidenceScale, -(int)transferenceValue); break; // interest scale case Globals.EMOTIONS.SURPRISED: eScript.interestScale = Transference(eScript.interestScale, (int)transferenceValue); break; case Globals.EMOTIONS.DISAPPOINTMENT: eScript.interestScale = Transference(eScript.interestScale, -(int)transferenceValue); break; // entertainment scale case Globals.EMOTIONS.BOREDOM: eScript.entertainmentScale = Transference(eScript.entertainmentScale, (int)transferenceValue); break; case Globals.EMOTIONS.ENTERTAINED: eScript.entertainmentScale = Transference(eScript.entertainmentScale, -(int)transferenceValue); break; default: break; } auraMaster.EventCheckEmotionalState(); }
public void EventColorChange(Globals.EMOTIONS e) { ColorChange?.Invoke(e); }
// ::: CALLS ::: // public void EventModifyEmotion(Globals.EMOTIONS emotion, float transferenceValue) { ModifyEmotion?.Invoke(emotion, transferenceValue); }