public void Shoot()
 {
     if (ai.GetTarget(out _target) && equipedWeapon.Shoot(_target))
     {
         animatorManager.Shoot();
         audioManager.Shoot(equipedWeapon.weaponInfo.shotSFX);
     }
 }
Пример #2
0
 void OnAnimatorIK()
 {
     if (ikActive)
     {
         if (ai.GetTarget(out target))
         {
             animatorManager.soldierAnimator.SetLookAtWeight(1f, 1f, 1f, 1f, 1f);
             Vector3 lookAtPosition = target.position;
             lookAtPosition.y += heightCompensation;
             animatorManager.soldierAnimator.SetLookAtPosition(lookAtPosition);
         }
     }
 }
Пример #3
0
 void Update()
 {
     if (animatorManager.navAgent.enabled)
     {
         if (animatorManager.navAgent.isStopped)
         {
             if (ai.GetTarget(out target))
             {
                 LookAtTarget(target.position);
             }
         }
         else
         {
             AddNavAgentRotation();
         }
     }
 }