示例#1
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();
         }
     }
 }
示例#2
0
    private void HandleFollowPlayerBehindAnimation()
    {
        // Change Animation state according to current speed
        float currentSpeed           = 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
        {
            animator.Idle();
        }
    }