From 8942cc918cdd4bff752e6245ec85024a2563b3b4 Mon Sep 17 00:00:00 2001 From: Jeonghyeon Ha Date: Tue, 19 Aug 2025 20:13:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=ED=84=B0=EC=95=A1=EC=85=98=20?= =?UTF-8?q?=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20=ED=99=95?= =?UTF-8?q?=EC=9E=A5=20=EB=B0=8F=20AI=20=EC=83=81=ED=98=B8=EC=9E=91?= =?UTF-8?q?=EC=9A=A9=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_DDD/_Scripts/GameEvent/IInteractable.cs | 3 +++ .../RestaurantInteractionComponent.cs | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs index 7eb3d9b2a..49c62717e 100644 --- a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs +++ b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs @@ -21,8 +21,11 @@ public interface IInteractable InteractionType GetInteractionType(); GameObject GetInteractableGameObject(); void InitializeInteraction(InteractionType interactionType); + // TODO : Struct InteractionExecutionParameters 등으로 정리 float GetRequiredHoldTime(); + // TODO : Struct InteractionDisplayParameters 등으로 정리 string GetInteractionMessageKey(); + Vector3[] GetInteractionPoints(); } public interface IInteractor diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs index 4fa0507b1..766b67be8 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs @@ -9,6 +9,7 @@ public class RestaurantInteractionComponent : MonoBehaviour, IInteractable [SerializeField] private string _interactionMessageKey = ""; [SerializeField] protected GameFlowState _interactionAvailableFlows; + [SerializeField] private Transform[] _aiInteractionPoints; public bool CanInteract() { @@ -57,5 +58,28 @@ public string GetInteractionMessageKey() { return _interactionMessageKey; } + + public Vector3[] GetInteractionPoints() + { + if (_aiInteractionPoints == null || _aiInteractionPoints.Length == 0) + { + // AI 상호작용 포인트가 설정되지 않은 경우 오브젝트의 위치를 기본값으로 반환 + return new Vector3[] { transform.position }; + } + + Vector3[] positions = new Vector3[_aiInteractionPoints.Length]; + for (int i = 0; i < _aiInteractionPoints.Length; i++) + { + if (_aiInteractionPoints[i] != null) + { + positions[i] = _aiInteractionPoints[i].position; + } + else + { + positions[i] = transform.position; + } + } + return positions; + } } } \ No newline at end of file