diff --git a/Assets/_DDD/Restaurant/Environments/Interactables/Common.meta b/Assets/_DDD/Restaurant/Environments/Interactables/Common.meta new file mode 100644 index 000000000..56795ff88 --- /dev/null +++ b/Assets/_DDD/Restaurant/Environments/Interactables/Common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b8b2fde5b3b345e292e0b6b951a4abd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab b/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab new file mode 100644 index 000000000..24036b0a6 --- /dev/null +++ b/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3857692527302447930 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1664322405549350652} + - component: {fileID: 8522104897182006738} + m_Layer: 0 + m_Name: InteractionPoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1664322405549350652 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3857692527302447930} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.4, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3697702677815423220} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &8522104897182006738 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3857692527302447930} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: c607300554a0c44469620484fccbf239, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &4103096974375017811 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3697702677815423220} + - component: {fileID: 3591347921553422000} + - component: {fileID: 4456475204957017828} + m_Layer: 7 + m_Name: RestaurantOrder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3697702677815423220 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4103096974375017811} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1664322405549350652} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3591347921553422000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4103096974375017811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3} + m_Name: + m_EditorClassIdentifier: + _interactionType: 4 + _executionParameters: + _holdTime: 0 + _displayParameters: + _messageKey: + _interactionAvailableFlows: 2 + _aiInteractionPoints: + - {fileID: 1664322405549350652} +--- !u!114 &4456475204957017828 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4103096974375017811} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c0b1e0992510498b8d33d5b6094b8f4b, type: 3} + m_Name: + m_EditorClassIdentifier: + orderType: 0 diff --git a/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab.meta b/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab.meta new file mode 100644 index 000000000..f06bbbf9f --- /dev/null +++ b/Assets/_DDD/Restaurant/Environments/Interactables/Common/RestaurantOrder.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2bbe3f26765344e6097aa9fd0f020fbf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/Restaurant/Environments/Props/CustomerTable.meta b/Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable.meta similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/CustomerTable.meta rename to Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable.meta diff --git a/Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.mat b/Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.mat similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.mat rename to Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.mat diff --git a/Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.mat.meta b/Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.mat.meta similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.mat.meta rename to Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.mat.meta diff --git a/Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.png b/Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.png similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.png rename to Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.png diff --git a/Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.png.meta b/Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.png.meta similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/CustomerTable/CustomerTable.png.meta rename to Assets/_DDD/Restaurant/Environments/Interactables/CustomerTable/CustomerTable.png.meta diff --git a/Assets/_DDD/Restaurant/Environments/Interactables/Prop_CustomerTable.prefab b/Assets/_DDD/Restaurant/Environments/Interactables/Prop_CustomerTable.prefab new file mode 100644 index 000000000..718e7e94e --- /dev/null +++ b/Assets/_DDD/Restaurant/Environments/Interactables/Prop_CustomerTable.prefab @@ -0,0 +1,238 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &2565741073186224478 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8881739536043914635} + m_Modifications: + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.y + value: 0.25 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4103096974375017811, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_Name + value: RestaurantOrder_001 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} +--- !u!4 &1210262234305268138 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + m_PrefabInstance: {fileID: 2565741073186224478} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4510296826299878002 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8881739536043914635} + m_Modifications: + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.x + value: -0.2 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.y + value: 0.25 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4103096974375017811, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + propertyPath: m_Name + value: RestaurantOrder + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} +--- !u!4 &992810551159552646 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3697702677815423220, guid: 2bbe3f26765344e6097aa9fd0f020fbf, type: 3} + m_PrefabInstance: {fileID: 4510296826299878002} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4777358697124966162 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_Name + value: Prop_CustomerTable + objectReference: {fileID: 0} + - target: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7856941568993672895, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8282162905857597943, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8467019391491472137, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: 'm_Materials.Array.data[0]' + value: + objectReference: {fileID: 2100000, guid: 56d0a02ae31152e45ba2da46f7694378, type: 2} + - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_Size.x + value: 0.93 + objectReference: {fileID: 0} + - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_Size.z + value: 0.31 + objectReference: {fileID: 0} + - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + propertyPath: m_Center.z + value: 0.14 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 4111453722694982297, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 992810551159552646} + - targetCorrespondingSourceObject: {fileID: 4111453722694982297, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 1210262234305268138} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} +--- !u!4 &8881739536043914635 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4111453722694982297, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + m_PrefabInstance: {fileID: 4777358697124966162} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/_DDD/Restaurant/Environments/Props/Prop_CustomerTable.prefab.meta b/Assets/_DDD/Restaurant/Environments/Interactables/Prop_CustomerTable.prefab.meta similarity index 100% rename from Assets/_DDD/Restaurant/Environments/Props/Prop_CustomerTable.prefab.meta rename to Assets/_DDD/Restaurant/Environments/Interactables/Prop_CustomerTable.prefab.meta diff --git a/Assets/_DDD/Restaurant/Environments/Props/Prop_CustomerTable.prefab b/Assets/_DDD/Restaurant/Environments/Props/Prop_CustomerTable.prefab deleted file mode 100644 index 2e83abd68..000000000 --- a/Assets/_DDD/Restaurant/Environments/Props/Prop_CustomerTable.prefab +++ /dev/null @@ -1,107 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &4777358697124966162 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalScale.x - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalScale.y - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalScale.z - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_ConstrainProportionsScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_Name - value: Prop_CustomerTable - objectReference: {fileID: 0} - - target: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_StaticEditorFlags - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7856941568993672895, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_StaticEditorFlags - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8282162905857597943, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_StaticEditorFlags - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8467019391491472137, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: 'm_Materials.Array.data[0]' - value: - objectReference: {fileID: 2100000, guid: 56d0a02ae31152e45ba2da46f7694378, type: 2} - - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_Size.x - value: 0.93 - objectReference: {fileID: 0} - - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_Size.z - value: 0.31 - objectReference: {fileID: 0} - - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_Center.z - value: 0.14 - objectReference: {fileID: 0} - - target: {fileID: 8516969404588314361, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} - propertyPath: m_IsTrigger - value: 1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} diff --git a/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab b/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab index fa7374f77..e3535c2f0 100644 --- a/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab +++ b/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab @@ -113,6 +113,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 6899480242032072806} + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: -4132148316966952702} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!1 &9211739394093953175 stripped GameObject: @@ -131,10 +134,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3} m_Name: m_EditorClassIdentifier: - _interactionType: 2 - _holdTime: 0 - _interactionMessageKey: Test + _interactionType: 1 + _executionParameters: + _holdTime: 1 + _displayParameters: + _messageKey: _interactionAvailableFlows: 1 + _aiInteractionPoints: [] + autoInitialize: 1 --- !u!114 &3538352761187622062 MonoBehaviour: m_ObjectHideFlags: 0 @@ -375,3 +382,16 @@ MonoBehaviour: _outlineSharpness: 8 _currentOutlineType: 0 _currentOpacityMultiplier: 1 +--- !u!114 &-4132148316966952702 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9211739394093953175} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1235f6bde9304d8f85079f2777bd4b3c, type: 3} + m_Name: + m_EditorClassIdentifier: + _managementType: 1 diff --git a/Assets/_DDD/_Addressables/Environments/Prop/MenuBoard/PropMenuBoard.prefab b/Assets/_DDD/_Addressables/Environments/Prop/MenuBoard/PropMenuBoard.prefab index a726ad5de..ebc868949 100644 --- a/Assets/_DDD/_Addressables/Environments/Prop/MenuBoard/PropMenuBoard.prefab +++ b/Assets/_DDD/_Addressables/Environments/Prop/MenuBoard/PropMenuBoard.prefab @@ -101,6 +101,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 5410819217098966190} + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: -1096657863250535257} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!1 &580268897300907643 stripped GameObject: @@ -120,8 +123,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _interactionType: 1 - _holdTime: 0 - _interactionMessageKey: Test + _executionParameters: + _holdTime: 1 + _displayParameters: + _messageKey: _interactionAvailableFlows: 1 _aiInteractionPoints: [] --- !u!114 &4545680930728379745 @@ -364,3 +369,15 @@ MonoBehaviour: _outlineSharpness: 8 _currentOutlineType: 0 _currentOpacityMultiplier: 1 +--- !u!114 &-1096657863250535257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 580268897300907643} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1235f6bde9304d8f85079f2777bd4b3c, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab index 92d5aded1..cc9051a7a 100644 --- a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab @@ -423,7 +423,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3} m_Name: m_EditorClassIdentifier: - _interactionType: 4294967295 + _availableInteractions: 1 _nearColliders: - {fileID: 0} - {fileID: 0} diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs index 49c62717e..00767d3be 100644 --- a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs +++ b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs @@ -8,10 +8,33 @@ namespace DDD public enum InteractionType : uint { None = 0u, - RestaurantManagementUi = 1u << 0, - OpenRestaurant = 1u << 1, + RestaurantManagement = 1u << 0, + RestaurantOrder = 1u << 1, + RestaurantMeal = 1u << 2, All = 0xFFFFFFFFu } + + [System.Serializable] + public struct InteractionExecutionParameters + { + [SerializeField] private float _holdTime; + public float HoldTime => _holdTime; + public InteractionExecutionParameters(float holdTime = 0f) + { + _holdTime = holdTime; + } + } + + [System.Serializable] + public struct InteractionDisplayParameters + { + [SerializeField] private string _messageKey; + public string MessageKey => _messageKey; + public InteractionDisplayParameters(string messageKey = "") + { + _messageKey = messageKey; + } + } public interface IInteractable { @@ -21,10 +44,8 @@ public interface IInteractable InteractionType GetInteractionType(); GameObject GetInteractableGameObject(); void InitializeInteraction(InteractionType interactionType); - // TODO : Struct InteractionExecutionParameters 등으로 정리 - float GetRequiredHoldTime(); - // TODO : Struct InteractionDisplayParameters 등으로 정리 - string GetInteractionMessageKey(); + InteractionExecutionParameters GetExecutionParameters(); + InteractionDisplayParameters GetDisplayParameters(); Vector3[] GetInteractionPoints(); } diff --git a/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs b/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs new file mode 100644 index 000000000..655419a6e --- /dev/null +++ b/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs @@ -0,0 +1,26 @@ +using System; +using UnityEngine; + +namespace DDD +{ + public interface IInteractionSubsystemObject + { + void InitializeSubsystem(); + bool CanInteract(); + bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null); + } + public interface IInteractionSubsystemObject : IInteractionSubsystemObject where T : Enum + { + T GetInteractionSubsystemType(); + } + + public interface IInteractionSubsystemSolver + { + } + public interface IInteractionSubsystemSolver : IInteractionSubsystemSolver where T : Enum + { + bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null); + bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs.meta new file mode 100644 index 000000000..1bea8095d --- /dev/null +++ b/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2e8dca10c7c74466bd1df632b7d111c4 +timeCreated: 1755665098 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs index 0772089b6..45c56de5d 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs @@ -23,7 +23,7 @@ protected virtual void Start() var flag = typeToSolver.Key; if (flag == InteractionType.None) continue; - if ((_interactionComponent.InteractionType & flag) == 0) continue; + if ((_interactionComponent.AvailableInteractions & flag) == 0) continue; if (!TryGetComponent(typeToSolver.Value, out _)) { diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs index 2ca1f4021..3db7a4412 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs @@ -6,10 +6,10 @@ namespace DDD { public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEventHandler { - [EnumToggleButtons, SerializeField] protected InteractionType _interactionType; + [EnumToggleButtons, SerializeField] protected InteractionType _availableInteractions; [SerializeField, ReadOnly] protected Collider[] _nearColliders = new Collider[10]; - public InteractionType InteractionType => _interactionType; + public InteractionType AvailableInteractions => _availableInteractions; protected IInteractable _nearestInteractable; protected IInteractable _previousInteractable; @@ -44,7 +44,7 @@ protected virtual void Update() _interactHeldTime += Time.deltaTime; - float requiredHoldTime = _interactingTarget.GetRequiredHoldTime(); + float requiredHoldTime = _interactingTarget.GetExecutionParameters().HoldTime; float ratio = Mathf.Clamp01(_interactHeldTime / requiredHoldTime); if (_interactHeldTime >= requiredHoldTime) diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs index 8f648cef9..a86e19447 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs @@ -49,7 +49,7 @@ private void OnInteractPerformed(InputAction.CallbackContext context) { if (_nearestInteractable == null || CanInteractTo(_nearestInteractable) == false) return; - float requiredHoldTime = _nearestInteractable.GetRequiredHoldTime(); + float requiredHoldTime = _nearestInteractable.GetExecutionParameters().HoldTime; if (requiredHoldTime <= 0f) { @@ -98,7 +98,7 @@ private void BroadcastShowUi(IInteractable interactable, bool canInteract, float { var evt = GameEvents.ShowInteractionUiEvent; evt.CanInteract = canInteract; - evt.TextKey = interactable.GetInteractionMessageKey(); + evt.TextKey = interactable.GetDisplayParameters().MessageKey; evt.HoldProgress = ratio; EventBus.Broadcast(evt); } diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs b/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs new file mode 100644 index 000000000..bd99e64be --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs @@ -0,0 +1,10 @@ +using System; +using UnityEngine; + +namespace DDD +{ + public interface IInteractionSubsystemOwner + { + public bool TryGetSubsystemObject(out IInteractionSubsystemObject subsystemObject) where T : Enum; + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs.meta b/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs.meta new file mode 100644 index 000000000..d15ead482 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 254d64ce6ee84b20a154931fcf04958f +timeCreated: 1755681729 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions.meta b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions.meta new file mode 100644 index 000000000..52a559f1d --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 30a19025059e4338b29bf140644dd5aa +timeCreated: 1755655803 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs new file mode 100644 index 000000000..8be8f9b3f --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs @@ -0,0 +1,36 @@ +using System; +using UnityEngine; + +namespace DDD +{ + [Flags] + public enum RestaurantManagementType : uint + { + OpenRestaurantMenu = 0, + StartRestaurant = 1, + } + + public class RestaurantManagementInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + { + [SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenRestaurantMenu; + public RestaurantManagementType GetInteractionSubsystemType() + { + return _managementType; + } + + public void InitializeSubsystem() + { + + } + + public bool CanInteract() + { + return true; + } + + public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs.meta new file mode 100644 index 000000000..2cf0b9e79 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1235f6bde9304d8f85079f2777bd4b3c +timeCreated: 1755671037 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs new file mode 100644 index 000000000..b224eb969 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs @@ -0,0 +1,54 @@ +using System; +using UnityEngine; + +namespace DDD +{ + [Flags] + public enum RestaurantOrderType : uint + { + Wait = 0u, + Reserved = 1u, + Order = 1u << 1, + Serve = 1u << 2, + } + + public class RestaurantOrderInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + { + [SerializeField] protected RestaurantOrderType orderType = RestaurantOrderType.Wait; + private RestaurantOrderType currentRestaurantOrderType; + + private void Start() + { + currentRestaurantOrderType = orderType; + } + + public bool CanInteract() + { + if (GetInteractionSubsystemType() == RestaurantOrderType.Wait) + { + return true; + } + return false; + } + + public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) + { + if (GetInteractionSubsystemType() == RestaurantOrderType.Wait) + { + // DO WAIT CUSTOMER + } + + return true; + } + + public void InitializeSubsystem() + { + + } + + public RestaurantOrderType GetInteractionSubsystemType() + { + return currentRestaurantOrderType; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs.meta new file mode 100644 index 000000000..97b6c0b9a --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c0b1e0992510498b8d33d5b6094b8f4b +timeCreated: 1755655843 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs b/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs index a2d647545..344fd6309 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs +++ b/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs @@ -1,3 +1,4 @@ +using System; using Spine.Unity; using Unity.VisualScripting; using UnityEngine; diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic.meta new file mode 100644 index 000000000..7a4acd006 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 59f8f35926714893bb8d4192e527fa48 +timeCreated: 1755655771 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/InteractableHighlight.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/InteractableHighlight.cs rename to Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/InteractableHighlight.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/InteractableHighlight.cs.meta rename to Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs index 766b67be8..2cf9c4102 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs @@ -1,29 +1,69 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; using UnityEngine; +using Sirenix.OdinInspector; namespace DDD { - public class RestaurantInteractionComponent : MonoBehaviour, IInteractable + public static class RestaurantInteractionSubsystems { - [SerializeField] private InteractionType _interactionType = InteractionType.None; - [SerializeField] private float _holdTime = 1f; - [SerializeField] private string _interactionMessageKey = ""; - + public static Dictionary TypeToSubsystem = new() + { + {InteractionType.RestaurantOrder, typeof(RestaurantOrderInteractionSubsystem)}, + {InteractionType.RestaurantManagement, typeof(RestaurantManagementInteractionSubsystem)} + }; + } + + + public class RestaurantInteractionComponent : MonoBehaviour, IInteractable, IInteractionSubsystemOwner + { + // Single interaction type + [ValueDropdown("GetAllInteractionTypes")] + [SerializeField] protected InteractionType _interactionType = InteractionType.None; + [SerializeField] protected InteractionExecutionParameters _executionParameters = new InteractionExecutionParameters(1f); + [SerializeField] protected InteractionDisplayParameters _displayParameters = new InteractionDisplayParameters(""); [SerializeField] protected GameFlowState _interactionAvailableFlows; [SerializeField] private Transform[] _aiInteractionPoints; - - public bool CanInteract() + [SerializeField] private bool autoInitialize = true; + + private Dictionary _subsystems = new(); + + private void Start() { - return !IsInteractionHidden(); + if (autoInitialize) + { + InitializeInteraction(_interactionType); + } } - public bool IsInteractionHidden() + private static IEnumerable GetAllInteractionTypes() + { + return System.Enum.GetValues(typeof(InteractionType)) + .Cast() + .Where(x => x != InteractionType.All); // All은 제외 + } + + public virtual bool CanInteract() + { + bool isInteractionVisible = !IsInteractionHidden(); + bool hasValidSubsystem = true; + if (HasSubsystem(_interactionType)) + { + hasValidSubsystem = GetSubsystem(_interactionType).CanInteract(); + } + return isInteractionVisible && hasValidSubsystem; + } + + public virtual bool IsInteractionHidden() { var currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; var flowDisabled = (currentGameFlowState & _interactionAvailableFlows) == 0; return flowDisabled; } - public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) + public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) { if (CanInteract() == false) { @@ -31,10 +71,14 @@ public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = nu } bool interactionResult = RestaurantInteractionEvents.RestaurantInteraction.RequestInteraction(interactor.GetInteractorGameObject(), GetInteractableGameObject(), GetInteractionType(), payloadSo, true); + if (HasSubsystem(_interactionType)) + { + interactionResult &= GetSubsystem(_interactionType).OnInteracted(interactor, payloadSo); + } return interactionResult; } - public InteractionType GetInteractionType() + public virtual InteractionType GetInteractionType() { return _interactionType; } @@ -44,26 +88,64 @@ public GameObject GetInteractableGameObject() return gameObject; } - public void InitializeInteraction(InteractionType interactionType) + public virtual void InitializeInteraction(InteractionType interactionType) { _interactionType = interactionType; + + InitializeSubsystems(); } + private void InitializeSubsystems() + { + // Initialize Interaction Subsystems + bool hasSubsystemType = RestaurantInteractionSubsystems.TypeToSubsystem.TryGetValue(_interactionType, out var subsystemType); + if (!hasSubsystemType) return; + + var subsystem = gameObject.GetComponent(subsystemType) as IInteractionSubsystemObject; + if (subsystem == null) + { + subsystem = gameObject.AddComponent(subsystemType) as IInteractionSubsystemObject; + } + _subsystems.Add(_interactionType, subsystem); + subsystem?.InitializeSubsystem(); + } + + private bool HasSubsystem(InteractionType interactionType) + { + return _subsystems.ContainsKey(interactionType); + } + + private IInteractionSubsystemObject GetSubsystem(InteractionType interactionType) + { + return _subsystems.GetValueOrDefault(interactionType) as IInteractionSubsystemObject; + } + + // 새로운 스트럭트 기반 메서드들 + public virtual InteractionExecutionParameters GetExecutionParameters() + { + return _executionParameters; + } + + public virtual InteractionDisplayParameters GetDisplayParameters() + { + return _displayParameters; + } + + // 하위 호환성을 위한 기존 메서드들 public float GetRequiredHoldTime() { - return _holdTime; + return _executionParameters.HoldTime; } public string GetInteractionMessageKey() { - return _interactionMessageKey; + return _displayParameters.MessageKey; } public Vector3[] GetInteractionPoints() { if (_aiInteractionPoints == null || _aiInteractionPoints.Length == 0) { - // AI 상호작용 포인트가 설정되지 않은 경우 오브젝트의 위치를 기본값으로 반환 return new Vector3[] { transform.position }; } @@ -81,5 +163,20 @@ public Vector3[] GetInteractionPoints() } return positions; } + + public bool TryGetSubsystemObject(out IInteractionSubsystemObject subsystemObject) where T : Enum + { + foreach (var interactionSubsystemObject in _subsystems.Values) + { + if (interactionSubsystemObject is IInteractionSubsystemObject subsystem) + { + subsystemObject = subsystem; + return true; + } + } + + subsystemObject = null; + return false; + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs index 2f86f12c3..2afa9b785 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs @@ -13,8 +13,8 @@ public static class RestaurantInteractionEventSolvers { public static Dictionary TypeToSolver = new() { - {InteractionType.RestaurantManagementUi, typeof(RestaurantManagementUiEventSolver)}, - {InteractionType.OpenRestaurant, typeof(RestaurantOpenEventSolver)} + {InteractionType.RestaurantManagement, typeof(RestaurantManagementSolver)}, + {InteractionType.RestaurantOrder, typeof(RestaurantOrderSolver)} }; } diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements.meta new file mode 100644 index 000000000..da3e18e6c --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ad4643acb4b34f1ab27e79503ccff0dd +timeCreated: 1755677592 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs new file mode 100644 index 000000000..0681cfb69 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using DDD.RestaurantOrders; +using UnityEngine; + +namespace DDD +{ + public static class RestaurantManagementSolvers + { + public static Dictionary TypeToManagementSolver = new() + { + { RestaurantManagementType.OpenRestaurantMenu, typeof(RestaurantManagementSolver_Menu) }, + { RestaurantManagementType.StartRestaurant, typeof(RestaurantManagementSolver_Start) } + }; + } + public class RestaurantManagementSolver : RestaurantSubsystemSolver + { + protected override Dictionary GetSubsystemSolverTypeMappings() + { + return RestaurantManagementSolvers.TypeToManagementSolver; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta new file mode 100644 index 000000000..a9847e43f --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c457857b6ba0432db546ef0d8970548d +timeCreated: 1755677639 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs similarity index 51% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs rename to Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs index c740cfb4f..4c4e3ab26 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs @@ -2,11 +2,11 @@ namespace DDD { - public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolver + public class RestaurantManagementSolver_Menu : MonoBehaviour, IInteractionSubsystemSolver { - public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) { - if (CanExecuteInteraction() == false) return false; + if (CanExecuteInteractionSubsystem(interactor, interactable, payloadSo) == false) return false; var evt = GameEvents.OpenPopupUiEvent; evt.UiType = typeof(RestaurantManagementUi); @@ -14,7 +14,7 @@ public bool ExecuteInteraction(IInteractor interactor, IInteractable interactabl return true; } - public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null) { GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs.meta rename to Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOpenEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs similarity index 53% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOpenEventSolver.cs rename to Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs index ccc92fd90..fe7f96388 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOpenEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs @@ -3,22 +3,23 @@ namespace DDD { - public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver + public class RestaurantManagementSolver_Start : MonoBehaviour, IInteractionSubsystemSolver { - public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) - { - if (CanExecuteInteraction() == false) return false; - - _ = GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant); - return true; - } - private RestaurantManagementState GetManagementState() { return RestaurantState.Instance.ManagementState; } - public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null) + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + if (CanExecuteInteractionSubsystem(interactor, interactable, payloadSo) == false) return false; + + _ = GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant); + return true; + } + + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) { GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOpenEventSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOpenEventSolver.cs.meta rename to Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs new file mode 100644 index 000000000..7f4019448 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using DDD.RestaurantOrders; +using UnityEngine; + +namespace DDD +{ + public static class RestaurantOrderSolvers + { + public static Dictionary TypeToOrderSolver = new() + { + { RestaurantOrderType.Wait, typeof(RestaurantOrderSolver_Wait) }, + { RestaurantOrderType.Reserved, typeof(RestaurantOrderSolver_Reserved) }, + { RestaurantOrderType.Order, typeof(RestaurantOrderSolver_Order) }, + { RestaurantOrderType.Serve, typeof(RestaurantOrderSolver_Serve) } + }; + } + + public class RestaurantOrderSolver : RestaurantSubsystemSolver + { + protected override Dictionary GetSubsystemSolverTypeMappings() + { + return RestaurantOrderSolvers.TypeToOrderSolver; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs.meta new file mode 100644 index 000000000..0d072c20a --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrderSolver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b832b16fa5964817afa836bc86f25f6b +timeCreated: 1755664610 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders.meta new file mode 100644 index 000000000..9518f5240 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0a7eea23af674c2aa6ffc20bd5801efb +timeCreated: 1755672003 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs new file mode 100644 index 000000000..edee1940d --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace DDD.RestaurantOrders +{ + public class RestaurantOrderSolver_Order : MonoBehaviour, IInteractionSubsystemSolver + { + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + // TODO : DO SOMETHING!!! + return true; + } + + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta new file mode 100644 index 000000000..a47a2ccd0 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3afc1759b02e4230967b3b72fe354ea3 +timeCreated: 1755672492 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs new file mode 100644 index 000000000..c12a9ab2b --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace DDD.RestaurantOrders +{ + public class RestaurantOrderSolver_Reserved : MonoBehaviour, IInteractionSubsystemSolver + { + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + // TODO : DO SOMETHING!!! + return true; + } + + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta new file mode 100644 index 000000000..9d4d3307f --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f62abf1706184529880b9353b63a2adc +timeCreated: 1755682089 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs new file mode 100644 index 000000000..263c65494 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace DDD.RestaurantOrders +{ + public class RestaurantOrderSolver_Serve : MonoBehaviour, IInteractionSubsystemSolver + { + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + // TODO : DO SOMETHING!!! + return true; + } + + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta new file mode 100644 index 000000000..3186c427f --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4df15c40347044648623d5932bb0724e +timeCreated: 1755672501 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs new file mode 100644 index 000000000..14f6f77d9 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace DDD.RestaurantOrders +{ + public class RestaurantOrderSolver_Wait : MonoBehaviour, IInteractionSubsystemSolver + { + public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + // TODO : DO SOMETHING!!! + return true; + } + + public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta new file mode 100644 index 000000000..3e85dc4c2 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cc81a22ff98a4b42b45ad27219ec05fa +timeCreated: 1755672371 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs new file mode 100644 index 000000000..6edbf5102 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + public abstract class RestaurantSubsystemSolver : MonoBehaviour, IInteractionSolver where T : Enum + { + private Dictionary> _solvers = new(); + + protected abstract Dictionary GetSubsystemSolverTypeMappings(); + + private void Start() + { + foreach (var subsystemSolverType in GetSubsystemSolverTypeMappings()) + { + var solver = (IInteractionSubsystemSolver)gameObject.AddComponent(subsystemSolverType.Value); + _solvers.Add(subsystemSolverType.Key, solver); + } + } + public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null) + { + return TryGetSolver(interactable, out var solver) && + solver.ExecuteInteractionSubsystem(interactor, interactable, payloadSo); + } + + public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, + ScriptableObject payloadSo = null) + { + return TryGetSolver(interactable, out var solver) && + solver.CanExecuteInteractionSubsystem(interactor, interactable, payloadSo); + } + + // Solver를 가져오는 공통 로직 + private bool TryGetSolver(IInteractable interactable, out IInteractionSubsystemSolver solver) + { + solver = null; + + var owner = interactable as IInteractionSubsystemOwner; + IInteractionSubsystemObject subsystem = null; + bool isExist = owner != null && owner.TryGetSubsystemObject(out subsystem); + + if (!isExist || subsystem == null) return false; + + var type = subsystem.GetInteractionSubsystemType(); + return _solvers.TryGetValue(type, out solver); + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs.meta new file mode 100644 index 000000000..a27412565 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 716224c78a914321b7b7e43a93860465 +timeCreated: 1755677990 \ No newline at end of file diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index ed8485fa0..6459f8e33 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f86abe14bf9fc4c7c93dfa96efd110ef0f56c3fb96a952c57e06a723fc87c352 +oid sha256:b8ae76b7c8f92890e759f46ff36b5db6b9e756533c8f14d3ef3ea41df7f4c5ad size 1075