diff --git a/Assets/JAY/Prefabs/ef_6.prefab b/Assets/JAY/Prefabs/ef_6.prefab index 44a3c5a3..9632ec26 100644 --- a/Assets/JAY/Prefabs/ef_6.prefab +++ b/Assets/JAY/Prefabs/ef_6.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ec61d705731975ffa0cae7ed41027694d14e2aa1c83760d5a3240621dfaa943 -size 3889 +oid sha256:d7677a4cb046b2baca7c83fa827a1b8c98bcca409dfaa35c3b792744fd0f487b +size 3884 diff --git a/Assets/JAY/Prefabs/ef_9.prefab b/Assets/JAY/Prefabs/ef_9.prefab deleted file mode 100644 index 882409ff..00000000 --- a/Assets/JAY/Prefabs/ef_9.prefab +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:474da4b5e548c5eb93cc110dd1c081273a5fadccfa35e0c043b88d69c8d92d3f -size 3855 diff --git a/Assets/JAY/Prefabs/ef_9_root.prefab b/Assets/JAY/Prefabs/ef_9_root.prefab new file mode 100644 index 00000000..a3b6df56 --- /dev/null +++ b/Assets/JAY/Prefabs/ef_9_root.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fb377b3ad5d1113082001f423f0f96e0cb1ef4b412a7eacb481e8ca89d4437a +size 4767 diff --git a/Assets/JAY/Prefabs/ef_9.prefab.meta b/Assets/JAY/Prefabs/ef_9_root.prefab.meta similarity index 74% rename from Assets/JAY/Prefabs/ef_9.prefab.meta rename to Assets/JAY/Prefabs/ef_9_root.prefab.meta index 742d4bf3..dac593ba 100644 --- a/Assets/JAY/Prefabs/ef_9.prefab.meta +++ b/Assets/JAY/Prefabs/ef_9_root.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e1c992841fb286344abd60f364376eaa +guid: 1d3a4e169aaf82a4697f426f27653a99 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/JAY/Scripts/Effect/EffectManager.cs b/Assets/JAY/Scripts/Effect/EffectManager.cs index 89fd74a6..ba42487e 100644 --- a/Assets/JAY/Scripts/Effect/EffectManager.cs +++ b/Assets/JAY/Scripts/Effect/EffectManager.cs @@ -26,7 +26,7 @@ public class EffectManager : Singleton Instantiate(prefab, position, Quaternion.identity); } - public void PlayEffect(Vector3 position, Quaternion rotation, EffectType type) + public GameObject PlayEffect(Vector3 pos, Quaternion rot, EffectType type) { GameObject prefab = null; @@ -38,10 +38,13 @@ public class EffectManager : Singleton } if (prefab != null) - Instantiate(prefab, position, rotation); + return Instantiate(prefab, pos, rot); + + return null; } + protected override void OnSceneLoaded(Scene scene, LoadSceneMode mode) { // TODO: 필요하면 씬 전환 시 이펙트 초기화 처리 diff --git a/Assets/JAY/Scripts/PlayerAction/PlayerActionAttack.cs b/Assets/JAY/Scripts/PlayerAction/PlayerActionAttack.cs index 03d9cd4c..bd6a6662 100644 --- a/Assets/JAY/Scripts/PlayerAction/PlayerActionAttack.cs +++ b/Assets/JAY/Scripts/PlayerAction/PlayerActionAttack.cs @@ -6,6 +6,8 @@ public class PlayerActionAttack : IPlayerAction { private int comboStep = 1; private bool comboQueued = false; private bool canReceiveCombo = false; + + public int CurrentComboStep => comboStep; public bool IsActive { get; private set; } diff --git a/Assets/JAY/Scripts/PlayerAction/PlayerActionDash.cs b/Assets/JAY/Scripts/PlayerAction/PlayerActionDash.cs index cdf698d9..2880a2c3 100644 --- a/Assets/JAY/Scripts/PlayerAction/PlayerActionDash.cs +++ b/Assets/JAY/Scripts/PlayerAction/PlayerActionDash.cs @@ -51,7 +51,6 @@ public class PlayerActionDash : IPlayerAction float dist = Vector3.Distance(currentEffectAnchorPos, lastEffectPos); if (dist >= effectSpacing) { - Debug.DrawLine(currentEffectAnchorPos, currentEffectAnchorPos + Vector3.up * 1f, Color.green, 1f); EffectManager.Instance.PlayEffect(currentEffectAnchorPos, EffectManager.EffectType.Dash); lastEffectPos = currentEffectAnchorPos; } diff --git a/Assets/JAY/Scripts/PlayerController.cs b/Assets/JAY/Scripts/PlayerController.cs index fa76992d..c90e9d2f 100644 --- a/Assets/JAY/Scripts/PlayerController.cs +++ b/Assets/JAY/Scripts/PlayerController.cs @@ -294,6 +294,7 @@ public class PlayerController : CharacterBase, IObserver if (_weaponController.IsAttacking) return; // 이미 공격 중이면 실행 안함 if (_currentAction == _attackAction) { + Debug.Log("공격 시작!"); _attackAction.EnableCombo(); _weaponController.AttackStart(); } @@ -302,6 +303,7 @@ public class PlayerController : CharacterBase, IObserver public void SetAttackComboFalse() { if (_currentAction == _attackAction) { + Debug.Log("공격 종료@"); // 이벤트 중복 호출? 공격 종료 시 SetAttackComboFalse가 아니라 ~True로 끝나서 오류 발생. (공격 안하는 상태여도 공격으로 판정됨) _attackAction.DisableCombo(); _weaponController.AttackEnd(); // IsAttacking = false로 변경 @@ -310,12 +312,31 @@ public class PlayerController : CharacterBase, IObserver public void PlayAttackEffect() { - if (_weaponController != null && _weaponController.AttackEffectAnchor != null) - { - Vector3 pos = _weaponController.AttackEffectAnchor.position; - Quaternion rot = _weaponController.AttackEffectAnchor.rotation; + if (_attackAction == null) return; - EffectManager.Instance.PlayEffect(pos, rot, EffectManager.EffectType.Attack); + // 현재 콤보 단계 (1~4) + int comboStep = _attackAction.CurrentComboStep; + + // 홀수면 기본 방향 (오→왼), 짝수면 반전 (왼→오) + bool isMirror = comboStep % 2 != 0; + + Vector3 basePos = CharacterController.transform.position; + Vector3 forward = CharacterController.transform.forward; + + float forwardPos = CurrentState == PlayerState.Move ? 1f : 0.2f; + + // 이펙트 위치: 위로 0.5 + 앞으로 약간 + Vector3 pos = basePos + Vector3.up * 0.5f + forward * forwardPos; + + Quaternion rot = Quaternion.LookRotation(forward, Vector3.up) * Quaternion.Euler(0, 90, 0); + GameObject effect = EffectManager.Instance.PlayEffect(pos, rot, EffectManager.EffectType.Attack); + + // 반전이 필요한 경우, X축 스케일 -1 + if (isMirror && effect != null) + { + Vector3 scale = effect.transform.localScale; + scale.z *= -1; + effect.transform.localScale = scale; } } diff --git a/Assets/JAY/Scripts/PlayerState/PlayerStateHit.cs b/Assets/JAY/Scripts/PlayerState/PlayerStateHit.cs index cc34e7e3..2051ffdc 100644 --- a/Assets/JAY/Scripts/PlayerState/PlayerStateHit.cs +++ b/Assets/JAY/Scripts/PlayerState/PlayerStateHit.cs @@ -19,6 +19,9 @@ public class PlayerStateHit : IPlayerState // 이펙트 및 카메라 흔들림 _playerController.PlayHitEffect(); _playerController.ShakeCamera(); + + Vector3 pos = _playerController.CharacterController.transform.position + Vector3.up * 0.5f; + EffectManager.Instance.PlayEffect(pos, EffectManager.EffectType.Hit); // 타이머 초기화 timer = 0f; diff --git a/Assets/StoreAssets/25 sprite effects/Animation_seq.cs b/Assets/StoreAssets/25 sprite effects/Animation_seq.cs index 1d3e930d..d4fd8a5c 100644 --- a/Assets/StoreAssets/25 sprite effects/Animation_seq.cs +++ b/Assets/StoreAssets/25 sprite effects/Animation_seq.cs @@ -37,7 +37,7 @@ public class Animation_seq : MonoBehaviour } else { - Destroy(gameObject); // 애니메이션 끝나면 제거 + Destroy(transform.root.gameObject); // 최상위 부모 삭제 } } }