문을 열었을 때는 NavMesh로 길을 통과할 수 있고, 닫혔을 때는 지나가지 못하도록 DoorSteel Prefab 수정
PlayerState 클래스 생성 - Die 메서드 추가
AttackingUpdate() 수정(추가)
if (!playerMovement.playerCanMove) { if (targetDistance < hideAttackDistance) // 너무 가까이 있을 때 숨으면 Die { playerState.Die(); isHiding = false; } isHiding = true; monster.aiState = AIStateType.Wandering; } else { isHiding = false; } if (targetDistance < 2f) // 닿으면 Die { agent.speed = 0f; playerState.Die(); }
닿았을 때 죽는 부분은 OnCollision으로 추후 수정