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