public void Upset() { state = PETSTATE.Upset; pet.ResetAnimations(); pet.animator.SetTrigger("Upset"); pet.Wait(animSettings.CelebrateTime, Stand); petAudio.PlayOneShot(petAudioUpset, 1.0F); }
public void Celebrate() { state = PETSTATE.Celebrating; if (needObject != null) { needObject.Unlock(); } pet.ResetAnimations(); pet.animator.SetTrigger("Celebrate"); pet.Wait(animSettings.CelebrateTime, Stand); petAudio.PlayOneShot(petAudioCelebrating, 1.0F); }
public void Introduce(NeedObject needObject) { if (state == PETSTATE.None || state == PETSTATE.Wandering || state == PETSTATE.Chasing) { this.needObject = needObject; state = PETSTATE.Chasing; pet.Chase(this.needObject, ChaseComplete); pet.ResetAnimations("Wander"); } }
public void ChaseBall() { if (needObject != null) { state = PETSTATE.Chasing; pet.Chase(this.needObject, ChaseComplete); pet.ResetAnimations("Wander"); } else { Stand(); } }
public void Wander() { state = PETSTATE.Wandering; if (health < 0.5) { pet.ResetAnimations("WanderUnsatisfied"); pet.Wander(Stand); } else { pet.ResetAnimations("Wander"); pet.Wander(Stand); } }
public void ChaseComplete() { //Do Need Need Task pet.ResetAnimations(); if (needObject == null) { mood.Stat -= 0.1f; Upset(); return; } state = needObject.toState; nutrition.Stat += needObject.nutritionGain; energy.Stat += needObject.energyGain; mood.Stat += needObject.moodGain; switch (state) { case PETSTATE.Eating: pet.animator.SetBool("Eating", true); pet.Wait(animSettings.EatTime, Celebrate); needObject.Lock(); petAudio.PlayOneShot(petAudioEating, 0.4F); break; case PETSTATE.Sleeping: pet.animator.SetBool("Sleep", true); pet.Wait(animSettings.SleepTime, Celebrate); needObject.Lock(); petAudio.PlayOneShot(petAudioSleep, 0.7F); break; case PETSTATE.Kicking: needObject.GetComponent <DragDrop>().Drop(); Vector2 kickVel = Random.insideUnitCircle * Random.Range(12f, 15f); needObject.GetComponent <ShadowObject>().Launch(kickVel, 2f); petAudio.PlayOneShot(petAudioKick, 0.8F); if (Random.Range(0f, 1f) > mood.Stat) { pet.Wait(0.5f, ChaseBall); } else { Celebrate(); } break; } }
public void Stand() { state = PETSTATE.None; pet.ResetAnimations(); pet.Wait(Random.Range(animSettings.IdleTime.x, animSettings.IdleTime.y), Wander); }