인터액션 인터페이스 확장 및 AI 상호작용 포인트 기능 추가

This commit is contained in:
Jeonghyeon Ha 2025-08-19 20:13:29 +09:00
parent 1c89abcb4b
commit 8942cc918c
2 changed files with 27 additions and 0 deletions

View File

@ -21,8 +21,11 @@ public interface IInteractable
InteractionType GetInteractionType(); InteractionType GetInteractionType();
GameObject GetInteractableGameObject(); GameObject GetInteractableGameObject();
void InitializeInteraction(InteractionType interactionType); void InitializeInteraction(InteractionType interactionType);
// TODO : Struct InteractionExecutionParameters 등으로 정리
float GetRequiredHoldTime(); float GetRequiredHoldTime();
// TODO : Struct InteractionDisplayParameters 등으로 정리
string GetInteractionMessageKey(); string GetInteractionMessageKey();
Vector3[] GetInteractionPoints();
} }
public interface IInteractor public interface IInteractor

View File

@ -9,6 +9,7 @@ public class RestaurantInteractionComponent : MonoBehaviour, IInteractable
[SerializeField] private string _interactionMessageKey = ""; [SerializeField] private string _interactionMessageKey = "";
[SerializeField] protected GameFlowState _interactionAvailableFlows; [SerializeField] protected GameFlowState _interactionAvailableFlows;
[SerializeField] private Transform[] _aiInteractionPoints;
public bool CanInteract() public bool CanInteract()
{ {
@ -57,5 +58,28 @@ public string GetInteractionMessageKey()
{ {
return _interactionMessageKey; 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;
}
} }
} }