public void PubRandomNegative() { EMOTIONS[] e = new EMOTIONS[] { EMOTIONS.sad, EMOTIONS.sassy, EMOTIONS.confused }; int choice = Random.Range(0, 3); PublishAction(e[choice]); }
void AutoSetMood() { // pissed? if (pissCounter > 1) { if (mood != EMOTIONS.PISSED) { Meow(); } mood = EMOTIONS.PISSED; return; } // asleep? if (mood == EMOTIONS.ASLEEP) { // keep sleeping until interrupted return; } // love? if (loveyTimer > 0) { mood = EMOTIONS.LOVEY; return; } // bored /*if (boredom >= maxBoredom) * { * mood = EMOTIONS.BORED; * return; * }*/ // default mood = EMOTIONS.BORED; }
public void PubRandomPositive() { EMOTIONS[] e = new EMOTIONS[] { EMOTIONS.happy, EMOTIONS.love, EMOTIONS.thinking }; int choice = Random.Range(0, 3); PublishAction(e[choice]); }
public override string DoAnimationAction(EMOTIONS e) { string action = e.ToString(); Anim.SetTrigger(action); return(action); }
public abstract string DoAnimationAction(EMOTIONS e);
public void PublishAction(EMOTIONS action) { message.data = action.ToString(); Publish(message); }
void OnCollisionEnter(Collision collision) { // hit another cat if (collision.gameObject.GetComponent <Cat>()) { // hit another cat quickly if (collision.relativeVelocity.sqrMagnitude > 10) { pissCounter = 10; RageHop(); } // already angry cat, auto angry else if (collision.gameObject.GetComponent <Cat>().pissCounter >= 10) { pissCounter = 10; RageHop(); } // hit a sleepy cat else if (collision.gameObject.GetComponent <Cat>().mood == EMOTIONS.ASLEEP) { boredom = 0; mood = EMOTIONS.ASLEEP; } } else { // wander if not on sleepy thing if (collision.collider.tag == "Soft") { boredom = 0; mood = EMOTIONS.ASLEEP; } else { if (mood == EMOTIONS.PISSED) { RageHop(); } boredom = 12; mood = EMOTIONS.BORED; } } // angry if hit too hard if (collision.relativeVelocity.sqrMagnitude > 15) { pissCounter = 10; } // grabbed toy if (collision.transform == Manager.instance.ActiveToy) { Grab(collision); } // old petting if (collision.collider.name.Contains("Controller")) { //Meow(); } else { // play impact sound // reuse meow interval for stopping repetitive hit sound if (!aSource.isPlaying && meowTimer > meowInterval / 2) { aSource.pitch = 1f; aSource.clip = ImpactSound; aSource.Play(); meowTimer = 0; // reuse meow timer } } }
public Emotion(EMOTIONS emotion, float intensity) { AppraisedEmotion = emotion; AppraisedIntensity = intensity; }
void LogAction(EMOTIONS e) { LoggingManager.instance.UpdateLogColumn(kuriPhysicalEmoteActionCol, e.ToString()); }
public override string DoAnimationAction(EMOTIONS e) { KuriEmoteStringPub.PublishAction(e); return(e.ToString()); }