Projectile Shooting Audio Added
This commit is contained in:
@@ -21,6 +21,7 @@ namespace AI
|
||||
protected bool isShooting = false;
|
||||
protected IMovement movement = null;
|
||||
protected Animator animator = null;
|
||||
protected AudioSource audioSource = null;
|
||||
protected int layerMask = ~(1 << 9);
|
||||
|
||||
protected bool canShoot => target != null && (target.transform.position - transform.position).sqrMagnitude < attackRangeSquared;
|
||||
@@ -44,6 +45,7 @@ namespace AI
|
||||
{
|
||||
movement = transform.GetComponentInParent<IMovement>();
|
||||
animator = transform.GetComponentInParent<Animator>();
|
||||
audioSource = transform.GetComponentInParent<AudioSource>();
|
||||
UpdateTarget(FindObjectOfType<Player.PlayerController>()?.transform);
|
||||
}
|
||||
|
||||
@@ -90,6 +92,7 @@ namespace AI
|
||||
projectile.SetVelocity(velocity);
|
||||
|
||||
remainingCooldown = cooldownPerShoot;
|
||||
audioSource.Play();
|
||||
OnShoot?.Invoke();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user