Esempio n. 1
0
 private void Update()
 {
     if (!muteFootsteps && dogAI.GetCurrentSpeed() > 0 && Vector3.Distance(lastFootstepLocation, transform.position) > strideLength)
     {
         PlayFootstep();
     }
 }
Esempio n. 2
0
 private void HandleInvestigateObjectiveAnimation()
 {
     if (animator)
     {
         // Change Animation state according to current speed
         float currentSpeed           = dorgAI.GetCurrentSpeed();
         float currentSpeedNormalized = currentSpeed / agent.speed;
         // Debug.Log("Current Speed Normalized: " + currentSpeedNormalized);
         if (currentSpeedNormalized > 0.75f)
         {
             animator.Run();
         }
         else if (currentSpeedNormalized > 0.05f)
         {
             animator.Trot();
         }
         else
         {
             // TODO: Only bark once or periodically, otherwise go Idle
             // TODO: Only Bark when close enough to the objective item
             //          otherwise go Idle (the item may not be close enough to the navMesh)
             animator.Bark();
         }
     }
 }