AttackState 공격 시 공격 궤적 스프라이트 노출되도록 수

This commit is contained in:
Mingu Kim
2025-08-22 22:02:35 +09:00
parent 8790e3982a
commit 3e551e99d0
4 changed files with 45 additions and 18 deletions

View File

@@ -43,8 +43,17 @@ public class PlayerMove : MonoBehaviour
_stateMachine = new StateMachine(State.IDLE, this);
// 공격 콜라이더 참조
attackCollider = GetComponentInChildren<Collider2D>();
// AttackArea 게임 오브젝트를 찾고 그 자식에서 Collider2D를 가져옵니다.
Transform attackAreaTransform = transform.Find("AttackArea");
if (attackAreaTransform != null)
{
attackCollider = attackAreaTransform.GetComponent<Collider2D>();
}
if (attackCollider == null)
{
Debug.LogError("AttackArea child object or Collider2D component not found!");
}
}
void Start()
@@ -57,11 +66,6 @@ public class PlayerMove : MonoBehaviour
_stateMachine.Update();
}
void FixedUpdate()
{
// FixedUpdate 로직은 이제 사용하지 않습니다.
}
void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.CompareTag("Enemy"))