ProjectDDD/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacter.cs
2025-08-12 20:46:30 +09:00

33 lines
908 B
C#

using Sirenix.OdinInspector;
using UnityEngine;
namespace DDD
{
public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor
{
[EnumToggleButtons, SerializeField] protected InteractionType _interactionType;
protected virtual void Awake() { }
protected virtual void Start()
{
foreach (var typeToSolver in RestaurantInteractionEventSolvers.TypeToSolver)
{
var flag = typeToSolver.Key;
if (flag == InteractionType.None) continue;
if ((_interactionType & flag) == 0) continue;
if (!TryGetComponent(typeToSolver.Value, out _))
{
gameObject.AddComponent(typeToSolver.Value);
}
}
}
public GameObject GetInteractorGameObject()
{
return gameObject;
}
}
}