/// <summary> /// Sets the current aim if needed /// </summary> protected virtual void Update() { if (_characterHandleWeapon == null) { return; } if (_characterHandleWeapon.CurrentWeapon != null) { if (_weaponAim != null) { if (_shooting) { _weaponAim.SetCurrentAim(_weaponAimDirection); } else { if (_character.IsFacingRight) { _weaponAim.SetCurrentAim(Vector3.right); } else { _weaponAim.SetCurrentAim(Vector3.left); } } } } }
/// <summary> /// Sends aim coordinates to the weapon aim component /// </summary> protected virtual void SetAim() { _aimDirection = (Target.transform.position - _raycastOrigin).normalized; _weaponAim.SetCurrentAim(_aimDirection); }