From e5ebb7183232493e225f4f4072540f78707546fa Mon Sep 17 00:00:00 2001 From: NTG Date: Wed, 27 Aug 2025 19:38:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=94=EB=A6=AC=EB=8F=84=EA=B5=AC=20ui?= =?UTF-8?q?=EC=99=80=20=EC=83=81=ED=98=B8=EC=9E=91=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prop/Brazier1/Prop_Brazier1.prefab | 16 +++++++++++++++ .../Environments/Prop/Fried/Prop_Fried.prefab | 16 +++++++++++++++ .../Environments/Prop/Pot1/Prop_Pot1.prefab | 16 +++++++++++++++ .../Prefabs/RestaurantPlayer.prefab | 2 +- .../Restaurant/Environment/Cookware.meta | 8 ++++++++ .../Environment/Cookware/CookwareComponent.cs | 14 +++++++++++++ .../Cookware/CookwareComponent.cs.meta | 2 ++ .../Interactions/InteractionSubsystem_Cook.cs | 5 ----- .../Event/RestaurantInteractionComponent.cs | 3 ++- .../RestaurantCookSolver_OpenCookUi.cs | 20 ++++++++++++++++++- .../FlowStates/RestaurantManagementState.cs | 5 +++++ 11 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 Assets/_DDD/_Scripts/Restaurant/Environment/Cookware.meta create mode 100644 Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs create mode 100644 Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs.meta diff --git a/Assets/_DDD/_Addressables/Environments/Prop/Brazier1/Prop_Brazier1.prefab b/Assets/_DDD/_Addressables/Environments/Prop/Brazier1/Prop_Brazier1.prefab index 91dfeb20b..95c5113ed 100644 --- a/Assets/_DDD/_Addressables/Environments/Prop/Brazier1/Prop_Brazier1.prefab +++ b/Assets/_DDD/_Addressables/Environments/Prop/Brazier1/Prop_Brazier1.prefab @@ -348,6 +348,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 4895648053684561955} + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 1633775615311007542} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!1 &1277704713268947483 stripped GameObject: @@ -627,6 +630,19 @@ MonoBehaviour: _outlineSharpness: 8 _currentOutlineType: 0 _currentOpacityMultiplier: 1 +--- !u!114 &1633775615311007542 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1277704713268947483} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 3 --- !u!4 &3654677467368248574 stripped Transform: m_CorrespondingSourceObject: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} diff --git a/Assets/_DDD/_Addressables/Environments/Prop/Fried/Prop_Fried.prefab b/Assets/_DDD/_Addressables/Environments/Prop/Fried/Prop_Fried.prefab index fcd871dc5..bdb84a03c 100644 --- a/Assets/_DDD/_Addressables/Environments/Prop/Fried/Prop_Fried.prefab +++ b/Assets/_DDD/_Addressables/Environments/Prop/Fried/Prop_Fried.prefab @@ -229,6 +229,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 6199984767033459821} + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 8977540742820762731} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!1 &4244061870577629946 stripped GameObject: @@ -508,6 +511,19 @@ MonoBehaviour: _outlineSharpness: 8 _currentOutlineType: 0 _currentOpacityMultiplier: 1 +--- !u!114 &8977540742820762731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4244061870577629946} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 2 --- !u!4 &4499382904539758566 stripped Transform: m_CorrespondingSourceObject: {fileID: 4111453722694982297, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} diff --git a/Assets/_DDD/_Addressables/Environments/Prop/Pot1/Prop_Pot1.prefab b/Assets/_DDD/_Addressables/Environments/Prop/Pot1/Prop_Pot1.prefab index cbc4fc20d..d1f17534a 100644 --- a/Assets/_DDD/_Addressables/Environments/Prop/Pot1/Prop_Pot1.prefab +++ b/Assets/_DDD/_Addressables/Environments/Prop/Pot1/Prop_Pot1.prefab @@ -265,6 +265,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 4049645275774486586} + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 216072919608443244} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!4 &8675645304246391653 stripped Transform: @@ -549,6 +552,19 @@ MonoBehaviour: _outlineSharpness: 8 _currentOutlineType: 0 _currentOpacityMultiplier: 1 +--- !u!114 &216072919608443244 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9003538228676253305} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 1 --- !u!1001 &5406243702551518767 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab index f842662b8..07a8b71f5 100644 --- a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab @@ -426,7 +426,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3} m_Name: m_EditorClassIdentifier: - _availableInteractions: 5 + _availableInteractions: 13 _nearColliders: - {fileID: 0} - {fileID: 0} diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware.meta new file mode 100644 index 000000000..7ee258702 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 759cab89a413f3e4cb8a9ae2afc2e48a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs new file mode 100644 index 000000000..2c7cd785b --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs @@ -0,0 +1,14 @@ +using UnityEngine; + +namespace DDD.Restaurant +{ + public interface ICookware + { + CookwareType CookwareType { get; } + } + + public class CookwareComponent : MonoBehaviour, ICookware + { + [field: SerializeField] public CookwareType CookwareType { get; private set; } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs.meta new file mode 100644 index 000000000..8fd1f937e --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Cookware/CookwareComponent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 51968825b07cc964fafbc62c69322b30 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs index c599b2af8..b70a77aec 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs @@ -37,10 +37,5 @@ public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloa { return true; } - - public ScriptableObject GetPayload() - { - return null; - } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs index 34bb0a1c3..46227d570 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs @@ -13,7 +13,8 @@ public static class RestaurantInteractionSubsystems { {InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)}, {InteractionType.RestaurantManagement, typeof(InteractionSubsystem_Management)}, - {InteractionType.RestaurantMeal, typeof(InteractionSubsystem_Meal)} + {InteractionType.RestaurantMeal, typeof(InteractionSubsystem_Meal)}, + {InteractionType.RestaurantCook, typeof(InteractionSubsystem_Cook)}, }; } diff --git a/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs index 3bcf4f904..55c89e123 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs @@ -4,19 +4,37 @@ namespace DDD.Restaurant { public class RestaurantCookSolver_OpenCookUi : MonoBehaviour, IInteractionSubsystemSolver { + private CookwareType _cookwareType; + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payload = null) { if (CanExecuteInteractionSubsystem(interactor, interactable, payload) == false) return false; var evt = GameEvents.OpenPopupUiEvent; evt.UiType = typeof(CookUi); - //evt.Payload = cookwareTypePayload.CookwareType; + evt.Payload = _cookwareType; EventBus.Broadcast(evt); return true; } public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payload = null) { + _cookwareType = CookwareType.None; + var iCookware = interactable?.GetInteractableGameObject().GetComponent(); + if (iCookware == null) return false; + + var interactableCookwareType = iCookware.CookwareType; + if (DataManager.Instance.GetDataSo().TryGetValueByCookwareType(interactableCookwareType, out var cookwareData) == false) + { + return false; + } + + if (RestaurantState.Instance.ManagementState.HasAddedCookByCookwareKey(cookwareData.Id) == false) + { + return false; + } + + _cookwareType = interactableCookwareType; GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; return currentGameFlowState == GameFlowState.RunRestaurant; } diff --git a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs index 1c5befdf7..bb0fb2705 100644 --- a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs @@ -254,5 +254,10 @@ public bool IsTodayMenuMatched(string cookwareId) return false; } + + public bool HasAddedCookByCookwareKey(string cookwareKey) + { + return _cookwareToRecipeIds.ContainsKey(cookwareKey) && _cookwareToRecipeIds[cookwareKey].Count > 0;; + } } } \ No newline at end of file