public void Shoot() { if (ai.GetTarget(out _target) && equipedWeapon.Shoot(_target)) { animatorManager.Shoot(); audioManager.Shoot(equipedWeapon.weaponInfo.shotSFX); } }
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); } } }
void Update() { if (animatorManager.navAgent.enabled) { if (animatorManager.navAgent.isStopped) { if (ai.GetTarget(out target)) { LookAtTarget(target.position); } } else { AddNavAgentRotation(); } } }