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에서 호출될 메서드
|
// Animation Event에서 호출될 메서드
|
||||||
public void SetAttackComboTrue() {
|
public void SetAttackComboTrue() {
|
||||||
|
if (_weaponController.IsAttacking) return; // 이미 공격 중이면 실행 안함
|
||||||
|
|
||||||
if (currentAction == attackAction) {
|
if (currentAction == attackAction) {
|
||||||
attackAction.EnableCombo();
|
attackAction.EnableCombo();
|
||||||
_weaponController.AttackStart();
|
_weaponController.AttackStart();
|
||||||
|
@ -29,13 +29,14 @@ public class WeaponController : MonoBehaviour, IObservable<GameObject>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private PlayerController _playerController;
|
private PlayerController _playerController;
|
||||||
|
private bool _isAttacking = false;
|
||||||
|
public bool IsAttacking => _isAttacking;
|
||||||
|
|
||||||
// 충돌 처리
|
// 충돌 처리
|
||||||
private Vector3[] _previousPositions;
|
private Vector3[] _previousPositions;
|
||||||
private HashSet<Collider> _hitColliders;
|
private HashSet<Collider> _hitColliders;
|
||||||
private Ray _ray = new Ray();
|
private Ray _ray = new Ray();
|
||||||
private RaycastHit[] _hits = new RaycastHit[10];
|
private RaycastHit[] _hits = new RaycastHit[10];
|
||||||
private bool _isAttacking = false;
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
@ -82,7 +83,9 @@ public class WeaponController : MonoBehaviour, IObservable<GameObject>
|
|||||||
var direction = worldPosition - _previousPositions[i];
|
var direction = worldPosition - _previousPositions[i];
|
||||||
_ray.origin = _previousPositions[i];
|
_ray.origin = _previousPositions[i];
|
||||||
_ray.direction = direction;
|
_ray.direction = direction;
|
||||||
|
|
||||||
|
if (direction.magnitude < 0.01f) return;
|
||||||
|
|
||||||
var hitCount = Physics.SphereCastNonAlloc(_ray,
|
var hitCount = Physics.SphereCastNonAlloc(_ray,
|
||||||
_triggerZones[i].radius, _hits,
|
_triggerZones[i].radius, _hits,
|
||||||
direction.magnitude, targetLayerMask,
|
direction.magnitude, targetLayerMask,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user