AttackState 공격 시 공격 궤적 스프라이트 노출되도록 수
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user