DEG-18 [UPDATE] 무기 타격 중복 버그 수정
This commit is contained in:
parent
e7169065cc
commit
90c00ec141
BIN
Assets/JAY/Animation/Attack01.anim
(Stored with Git LFS)
BIN
Assets/JAY/Animation/Attack01.anim
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/JAY/Animation/Attack02.anim
(Stored with Git LFS)
BIN
Assets/JAY/Animation/Attack02.anim
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/JAY/Animation/Attack03.anim
(Stored with Git LFS)
BIN
Assets/JAY/Animation/Attack03.anim
(Stored with Git LFS)
Binary file not shown.
@ -131,6 +131,8 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
||||
|
||||
// Animation Event에서 호출될 메서드
|
||||
public void SetAttackComboTrue() {
|
||||
if (_weaponController.IsAttacking) return; // 이미 공격 중이면 실행 안함
|
||||
|
||||
if (currentAction == attackAction) {
|
||||
attackAction.EnableCombo();
|
||||
_weaponController.AttackStart();
|
||||
|
@ -29,13 +29,14 @@ public class WeaponController : MonoBehaviour, IObservable<GameObject>
|
||||
}
|
||||
}
|
||||
private PlayerController _playerController;
|
||||
private bool _isAttacking = false;
|
||||
public bool IsAttacking => _isAttacking;
|
||||
|
||||
// 충돌 처리
|
||||
private Vector3[] _previousPositions;
|
||||
private HashSet<Collider> _hitColliders;
|
||||
private Ray _ray = new Ray();
|
||||
private RaycastHit[] _hits = new RaycastHit[10];
|
||||
private bool _isAttacking = false;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@ -83,6 +84,8 @@ public class WeaponController : MonoBehaviour, IObservable<GameObject>
|
||||
_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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user