인터액션 인터페이스 확장 및 AI 상호작용 포인트 기능 추가
This commit is contained in:
parent
1c89abcb4b
commit
8942cc918c
@ -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
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user