ProjectDDD/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs
김산 556ddcba13 Merge remote-tracking branch 'origin/develop' into feature/customer_behavior
# Conflicts:
#	Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs
2025-08-26 19:00:07 +09:00

77 lines
2.0 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;
private ScriptableObject _cachedPayload;
private void OnDestroy()
{
if (_cachedPayload)
{
DestroyImmediate(_cachedPayload);
_cachedPayload = null;
}
}
public RestaurantManagementType GetInteractionSubsystemType()
{
return _managementType;
}
public void SetInteractionSubsystemType(RestaurantManagementType inValue)
{
_managementType = inValue;
}
public void InitializeSubsystem()
{
}
public bool CanInteract()
{
return true;
}
public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null)
{
return true;
}
public ScriptableObject GetPayload()
{
if (_managementType == RestaurantManagementType.OpenCookUi)
{
if (!_cachedPayload)
{
_cachedPayload = ScriptableObject.CreateInstance(typeof(CookwareTypePayload));
}
var payload = _cachedPayload as CookwareTypePayload;
payload.CookwareType = _cookwareType;
return payload;
}
return null;
}
}
}