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; } } }