From a85f4d8fed686290f998eea24d1631c017d054e3 Mon Sep 17 00:00:00 2001 From: dal4segno Date: Fri, 13 Feb 2026 15:31:10 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=AC=EC=8A=A4=ED=84=B0=EC=9D=98=20?= =?UTF-8?q?=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4=20=EC=B6=94=EA=B2=A9=20AI(?= =?UTF-8?q?=EC=9E=84=EC=8B=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 코어를 향해 전진하는 도중, 사거리 내에 플레이어가 들어올 시 추격하도록 함 --- Assets/Scripts/EnemyAIController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Assets/Scripts/EnemyAIController.cs b/Assets/Scripts/EnemyAIController.cs index 8e87a1c..bce4ccb 100644 --- a/Assets/Scripts/EnemyAIController.cs +++ b/Assets/Scripts/EnemyAIController.cs @@ -154,6 +154,15 @@ namespace Northbound if (_isRecalculatingPath) return; // 코루틴 대기 중이면 중단 if (_coreTransform == null) { FindCore(); return; } + // 0. Player 감지 (코어로 가는 도중에도 Player를 타겟팅) + GameObject detectedPlayer = DetectTarget(); + if (detectedPlayer != null) + { + SetTargetPlayer(detectedPlayer); + TransitionToState(EnemyAIState.ChasePlayer); + return; + } + // 1. 코어로 가는 경로가 '완전(Complete)'한지 먼저 확인 // NavMesh가 갱신되었다면 에이전트는 즉시 Complete 상태가 됩니다. if (_agent.hasPath && _agent.pathStatus == NavMeshPathStatus.PathComplete)