2025-08-08 06:44:11 +00:00
|
|
|
using Sirenix.OdinInspector;
|
2025-07-09 09:45:11 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace DDD
|
|
|
|
{
|
2025-07-22 11:15:20 +00:00
|
|
|
public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor
|
2025-07-09 09:45:11 +00:00
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
[EnumToggleButtons, SerializeField] protected InteractionType _interactionType;
|
2025-08-12 11:46:30 +00:00
|
|
|
|
|
|
|
protected virtual void Awake() { }
|
|
|
|
|
|
|
|
protected virtual void Start()
|
2025-07-22 11:15:20 +00:00
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
foreach (var typeToSolver in RestaurantInteractionEventSolvers.TypeToSolver)
|
2025-07-22 11:15:20 +00:00
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
var flag = typeToSolver.Key;
|
|
|
|
if (flag == InteractionType.None) continue;
|
|
|
|
|
|
|
|
if ((_interactionType & flag) == 0) continue;
|
|
|
|
|
|
|
|
if (!TryGetComponent(typeToSolver.Value, out _))
|
2025-07-22 11:15:20 +00:00
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
gameObject.AddComponent(typeToSolver.Value);
|
2025-07-22 11:15:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public GameObject GetInteractorGameObject()
|
|
|
|
{
|
2025-08-05 08:09:14 +00:00
|
|
|
return gameObject;
|
2025-07-22 11:15:20 +00:00
|
|
|
}
|
2025-07-09 09:45:11 +00:00
|
|
|
}
|
|
|
|
}
|