void ChangeState(HumanState newState) { switch (newState) { case HumanState.Walking: seenItem = null; seenPlayer = null; targetSpeed = walkSpeed; look.LooseFocus(); emotion.Hide(); MoveTo(currentWaypoint); break; case HumanState.Thinking: targetSpeed = 0; SoundPlayer.PlayAtPosition("si_concerned_human", transform.position, 0.1f, true); break; case HumanState.Chasing: emotion.Show("Suprised"); targetSpeed = chaseSpeed; SoundPlayer.PlayAtPosition("si_raccoon_spotted", transform.position, 0.1f, false); break; case HumanState.Collecting: seenPlayer = null; break; } state = newState; }
void UpdateHead() { if (heldObject == null) { Grabbable g = GetBestObjectAtRange(); if (g != null) { look.FocusOn(g.transform); } else if (look.isFocused) { look.LooseFocus(); } } }