cook subsystem 분리

This commit is contained in:
NTG 2025-08-27 13:05:08 +09:00
parent fdfc970a09
commit 571fa1e4f0
19 changed files with 100 additions and 61 deletions

View File

@ -341,7 +341,7 @@ PrefabInstance:
addedObject: {fileID: 9109890696398459938}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 3145838323634625451}
addedObject: {fileID: 3704461866945454015}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 2515144362112859512}
@ -366,7 +366,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactionType: 1
_interactionType: 8
_executionParameters:
_holdTime: 0
_displayParameters:
@ -374,7 +374,7 @@ MonoBehaviour:
_interactionAvailableFlows: 2
_aiInteractionPoints: []
autoInitialize: 1
--- !u!114 &3145838323634625451
--- !u!114 &3704461866945454015
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -383,11 +383,10 @@ MonoBehaviour:
m_GameObject: {fileID: 1277704713268947483}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1235f6bde9304d8f85079f2777bd4b3c, type: 3}
m_Script: {fileID: 11500000, guid: f7cf7dcfed7214940a2dc7d2fa00d8e9, type: 3}
m_Name:
m_EditorClassIdentifier:
_managementType: 2
_cookwareType: 3
_cookType: 0
--- !u!114 &2515144362112859512
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -222,7 +222,7 @@ PrefabInstance:
addedObject: {fileID: 3416739030224185287}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 1441865946434836334}
addedObject: {fileID: 1180009216042736354}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 8087722827342679631}
@ -247,7 +247,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactionType: 1
_interactionType: 8
_executionParameters:
_holdTime: 0
_displayParameters:
@ -255,7 +255,7 @@ MonoBehaviour:
_interactionAvailableFlows: 2
_aiInteractionPoints: []
autoInitialize: 1
--- !u!114 &1441865946434836334
--- !u!114 &1180009216042736354
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -264,11 +264,10 @@ MonoBehaviour:
m_GameObject: {fileID: 4244061870577629946}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1235f6bde9304d8f85079f2777bd4b3c, type: 3}
m_Script: {fileID: 11500000, guid: f7cf7dcfed7214940a2dc7d2fa00d8e9, type: 3}
m_Name:
m_EditorClassIdentifier:
_managementType: 2
_cookwareType: 2
_cookType: 0
--- !u!114 &8087722827342679631
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -21,7 +21,7 @@ Material:
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:

View File

@ -21,7 +21,7 @@ Material:
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:

View File

@ -34,7 +34,7 @@ Material:
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:

View File

@ -258,7 +258,7 @@ PrefabInstance:
addedObject: {fileID: 5203686636443694984}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 4290522184515279384}
addedObject: {fileID: 276462347427572734}
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
insertIndex: -1
addedObject: {fileID: 1120162909698458040}
@ -288,7 +288,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactionType: 1
_interactionType: 8
_executionParameters:
_holdTime: 0
_displayParameters:
@ -296,7 +296,7 @@ MonoBehaviour:
_interactionAvailableFlows: 2
_aiInteractionPoints: []
autoInitialize: 1
--- !u!114 &4290522184515279384
--- !u!114 &276462347427572734
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -305,11 +305,10 @@ MonoBehaviour:
m_GameObject: {fileID: 9003538228676253305}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1235f6bde9304d8f85079f2777bd4b3c, type: 3}
m_Script: {fileID: 11500000, guid: f7cf7dcfed7214940a2dc7d2fa00d8e9, type: 3}
m_Name:
m_EditorClassIdentifier:
_managementType: 2
_cookwareType: 1
_cookType: 0
--- !u!114 &1120162909698458040
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -23,6 +23,7 @@ public async Task LoadData()
}
var gameLocalizationDataHandle = _gameLocalizationData.LoadAssetAsync<GameLocalizationData>();
var test = AssetManager.LoadAsset<GameLocalizationData>(_gameLocalizationData.AssetGUID);
var popupUiDataHandle = _uiData.LoadAssetAsync<UiData>();
await gameLocalizationDataHandle.Task;

View File

@ -11,6 +11,7 @@ public enum InteractionType : uint
RestaurantManagement = 1u << 0,
RestaurantOrder = 1u << 1,
RestaurantMeal = 1u << 2,
RestaurantCook = 1u << 3,
All = 0xFFFFFFFFu
}

View File

@ -0,0 +1,41 @@
using System;
using UnityEngine;
namespace DDD
{
[Flags]
public enum RestaurantCookType : uint
{
OpenCookUi = 0,
}
public class RestaurantCookInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject<RestaurantCookType>
{
[SerializeField] protected RestaurantCookType _cookType = RestaurantCookType.OpenCookUi;
public RestaurantCookType GetInteractionSubsystemType()
{
return _cookType;
}
public virtual void InitializeSubsystem()
{
}
public virtual bool CanInteract()
{
return true;
}
public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null)
{
return true;
}
public ScriptableObject GetPayload()
{
return null;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f7cf7dcfed7214940a2dc7d2fa00d8e9
timeCreated: 1755671037

View File

@ -8,29 +8,11 @@ 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()
{
@ -54,18 +36,6 @@ public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloa
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;
}
}

View File

@ -14,7 +14,8 @@ public static class RestaurantInteractionEventSolvers
public static Dictionary<InteractionType, Type> TypeToSolver = new()
{
{InteractionType.RestaurantManagement, typeof(RestaurantManagementSolver)},
{InteractionType.RestaurantOrder, typeof(RestaurantOrderSolver)}
{InteractionType.RestaurantOrder, typeof(RestaurantOrderSolver)},
{InteractionType.RestaurantCook, typeof(RestaurantCookSolver)}
};
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 40f81333eaf94a8d87dd93f56e694f9f
timeCreated: 1756266293

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
namespace DDD
{
public static class RestaurantCookSolvers
{
public static Dictionary<RestaurantCookType, Type> TypeToManagementSolver = new()
{
{ RestaurantCookType.OpenCookUi, typeof(RestaurantCookSolver_OpenCookUi) },
};
}
public class RestaurantCookSolver : RestaurantSubsystemSolver<RestaurantCookType>
{
protected override Dictionary<RestaurantCookType, Type> GetSubsystemSolverTypeMappings()
{
return RestaurantCookSolvers.TypeToManagementSolver;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f559834f1ac07564aa79705326799af4
timeCreated: 1755677639

View File

@ -2,22 +2,22 @@
namespace DDD
{
public class RestaurantManagementSolver_Cook : MonoBehaviour, IInteractionSubsystemSolver<RestaurantManagementType>
public class RestaurantCookSolver_OpenCookUi : MonoBehaviour, IInteractionSubsystemSolver<RestaurantCookType>
{
public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject causerPayload = null, ScriptableObject targetPayloadSo = null)
public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable,
ScriptableObject causerPayload = null, ScriptableObject targetPayloadSo = null)
{
if (CanExecuteInteractionSubsystem(interactor, interactable, causerPayload, targetPayloadSo) == false) return false;
var cookwareTypePayload = targetPayloadSo as CookwareTypePayload;
var evt = GameEvents.OpenPopupUiEvent;
evt.UiType = typeof(CookUi);
evt.Payload = cookwareTypePayload.CookwareType;
//evt.Payload = cookwareTypePayload.CookwareType;
EventBus.Broadcast(evt);
return true;
}
public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject causerPayload = null, ScriptableObject targetPayloadSo = null)
public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null,
ScriptableObject causerPayload = null, ScriptableObject targetPayloadSo = null)
{
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
return currentGameFlowState == GameFlowState.RunRestaurant;

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 13aa19466e35b644593189245f6def22

View File

@ -9,7 +9,6 @@ public static class RestaurantManagementSolvers
{
{ RestaurantManagementType.OpenRestaurantMenu, typeof(RestaurantManagementSolver_Menu) },
{ RestaurantManagementType.StartRestaurant, typeof(RestaurantManagementSolver_Start) },
{ RestaurantManagementType.OpenCookUi, typeof(RestaurantManagementSolver_Cook) },
};
}
public class RestaurantManagementSolver : RestaurantSubsystemSolver<RestaurantManagementType>

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 1ec01cfc3ad3d4e40ba166cf8049adb3