diff --git a/Assets/JAY/Animation/Attack01.anim b/Assets/JAY/Animation/Attack01.anim index ccf26dd9..9fb0603f 100644 --- a/Assets/JAY/Animation/Attack01.anim +++ b/Assets/JAY/Animation/Attack01.anim @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff89c66614bf77aca6b21457902509d878dab266578f6d69878a2266ea7ec4fa -size 874011 +oid sha256:12dd7f6ed05e3a7a1b74c66c18384155486ee1f6ea0ce906bb5ecd1d0b63c201 +size 874004 diff --git a/Assets/JAY/Animation/Attack02.anim b/Assets/JAY/Animation/Attack02.anim index 796d1efb..d8941b4f 100644 --- a/Assets/JAY/Animation/Attack02.anim +++ b/Assets/JAY/Animation/Attack02.anim @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:24f7ad70756e8581b0e29837f63b0cd778239d0e814ca8e6fba9f1369135ad15 -size 915074 +oid sha256:a9adcb09bcb2b324834e2839eeb6f4bf3abb13fe98cc7b847d14358367e157e6 +size 915067 diff --git a/Assets/JAY/Animation/Attack03.anim b/Assets/JAY/Animation/Attack03.anim index e3d35d5e..0d186021 100644 --- a/Assets/JAY/Animation/Attack03.anim +++ b/Assets/JAY/Animation/Attack03.anim @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7c047dd8e6f911de18984f8f22b41642f540216eb00405e1f3f88ed9b17ede1 -size 1696284 +oid sha256:1106bc4ef3b68218eba134e4306e647494affab839453169245d50bf503897f1 +size 1696277 diff --git a/Assets/JAY/Scripts/PlayerController.cs b/Assets/JAY/Scripts/PlayerController.cs index 6dd94b93..92e05880 100644 --- a/Assets/JAY/Scripts/PlayerController.cs +++ b/Assets/JAY/Scripts/PlayerController.cs @@ -131,6 +131,8 @@ public class PlayerController : CharacterBase, IObserver // Animation Event에서 호출될 메서드 public void SetAttackComboTrue() { + if (_weaponController.IsAttacking) return; // 이미 공격 중이면 실행 안함 + if (currentAction == attackAction) { attackAction.EnableCombo(); _weaponController.AttackStart(); diff --git a/Assets/JAY/Scripts/WeaponController.cs b/Assets/JAY/Scripts/WeaponController.cs index 84c988cc..032227ce 100644 --- a/Assets/JAY/Scripts/WeaponController.cs +++ b/Assets/JAY/Scripts/WeaponController.cs @@ -29,13 +29,14 @@ public class WeaponController : MonoBehaviour, IObservable } } private PlayerController _playerController; + private bool _isAttacking = false; + public bool IsAttacking => _isAttacking; // 충돌 처리 private Vector3[] _previousPositions; private HashSet _hitColliders; private Ray _ray = new Ray(); private RaycastHit[] _hits = new RaycastHit[10]; - private bool _isAttacking = false; private void Start() { @@ -82,7 +83,9 @@ public class WeaponController : MonoBehaviour, IObservable var direction = worldPosition - _previousPositions[i]; _ray.origin = _previousPositions[i]; _ray.direction = direction; - + + if (direction.magnitude < 0.01f) return; + var hitCount = Physics.SphereCastNonAlloc(_ray, _triggerZones[i].radius, _hits, direction.magnitude, targetLayerMask,