몬스터의 플레이어 추격 AI(임시)
코어를 향해 전진하는 도중, 사거리 내에 플레이어가 들어올 시 추격하도록 함
This commit is contained in:
@@ -154,6 +154,15 @@ namespace Northbound
|
|||||||
if (_isRecalculatingPath) return; // 코루틴 대기 중이면 중단
|
if (_isRecalculatingPath) return; // 코루틴 대기 중이면 중단
|
||||||
if (_coreTransform == null) { FindCore(); return; }
|
if (_coreTransform == null) { FindCore(); return; }
|
||||||
|
|
||||||
|
// 0. Player 감지 (코어로 가는 도중에도 Player를 타겟팅)
|
||||||
|
GameObject detectedPlayer = DetectTarget();
|
||||||
|
if (detectedPlayer != null)
|
||||||
|
{
|
||||||
|
SetTargetPlayer(detectedPlayer);
|
||||||
|
TransitionToState(EnemyAIState.ChasePlayer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. 코어로 가는 경로가 '완전(Complete)'한지 먼저 확인
|
// 1. 코어로 가는 경로가 '완전(Complete)'한지 먼저 확인
|
||||||
// NavMesh가 갱신되었다면 에이전트는 즉시 Complete 상태가 됩니다.
|
// NavMesh가 갱신되었다면 에이전트는 즉시 Complete 상태가 됩니다.
|
||||||
if (_agent.hasPath && _agent.pathStatus == NavMeshPathStatus.PathComplete)
|
if (_agent.hasPath && _agent.pathStatus == NavMeshPathStatus.PathComplete)
|
||||||
|
|||||||
Reference in New Issue
Block a user