ProjectDDD/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs

56 lines
1.5 KiB
C#

using System;
using UnityEngine;
namespace DDD
{
[Flags]
public enum RestaurantManagementType : uint
{
OpenRestaurantMenu = 0,
StartRestaurant = 1,
OpenCookUi = 2,
}
public class CookwareTypePayload : ScriptableObject
{
public CookwareType CookwareType;
}
public class RestaurantManagementInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject<RestaurantManagementType>
{
[SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenRestaurantMenu;
[SerializeField] private CookwareType _cookwareType = CookwareType.None;
public RestaurantManagementType GetInteractionSubsystemType()
{
return _managementType;
}
public virtual void InitializeSubsystem()
{
}
public virtual bool CanInteract()
{
return true;
}
public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null)
{
return true;
}
public ScriptableObject GetPayload()
{
if (_managementType == RestaurantManagementType.OpenCookUi)
{
var payloadInstance = ScriptableObject.CreateInstance(typeof(CookwareTypePayload)) as CookwareTypePayload;
payloadInstance.CookwareType = _cookwareType;
return payloadInstance;
}
return null;
}
}
}