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

33 lines
908 B
C#
Raw Normal View History

using Sirenix.OdinInspector;
2025-07-09 09:45:11 +00:00
using UnityEngine;
namespace DDD
{
public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor
2025-07-09 09:45:11 +00:00
{
[EnumToggleButtons, SerializeField] protected InteractionType _interactionType;
2025-08-12 11:46:30 +00:00
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;
}
2025-07-09 09:45:11 +00:00
}
}