ProjectDDD/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacter.cs

26 lines
784 B
C#

using UnityEngine;
namespace DDD
{
public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor
{
private void Start()
{
// TODO : Add event solvers dynamically
for (int i = 0; i < (int)InteractionType.Count; i++)
{
InteractionType interactionType = (InteractionType)i;
// TODO : if this character should handle the interaction?
if (RestaurantInteractionEventSolvers.TypeToSolver.TryGetValue(interactionType, out var solverType))
{
gameObject.AddComponent(solverType);
}
}
}
public GameObject GetInteractorGameObject()
{
return gameObject;
}
}
}