From 239ab0601a173f331ccc3e9164f390360370e562 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Wed, 6 Aug 2025 17:43:41 +0900 Subject: [PATCH 01/15] =?UTF-8?q?=EC=83=81=ED=98=B8=EC=9E=91=EC=9A=A9=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RestaurantCharacterInteraction.cs | 166 +++++------------- .../RestaurantPlayerInteraction.cs | 105 +++++++++++ 2 files changed, 150 insertions(+), 121 deletions(-) create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs index 585a6316f..014f8acd4 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs @@ -1,62 +1,39 @@ -using System.Threading.Tasks; using Sirenix.OdinInspector; using UnityEngine; -using UnityEngine.InputSystem; namespace DDD { public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEventHandler { - private RestaurantPlayerDataSo _restaurantPlayerDataSo; - - [ReadOnly, SerializeField] private Collider[] _nearColliders = new Collider[10]; - private IInteractable _nearestInteractable; - private IInteractable _previousInteractable; - private IInteractable _interactingTarget; - - private float _interactHeldTime; - private bool _isInteracting; - - private void Start() - { - _ = Initialize(); - } + [SerializeField, ReadOnly] protected Collider[] _nearColliders = new Collider[10]; - private void Update() - { - if (!_restaurantPlayerDataSo) return; + protected IInteractable _nearestInteractable; + protected IInteractable _previousInteractable; + protected IInteractable _interactingTarget; + protected float _interactHeldTime; + protected bool _isInteracting; + + protected float _interactionRadius = 1f; + protected LayerMask _interactionLayerMask = (LayerMask)(-1); + + protected virtual void Start() { } + + protected virtual void Update() + { _nearestInteractable = GetNearestInteractable(); if (_nearestInteractable != _previousInteractable) { _previousInteractable = _nearestInteractable; - - if (_nearestInteractable != null && _nearestInteractable.CanInteract()) - { - BroadcastShowUi(_nearestInteractable, 0f); - } - else - { - EventBus.Broadcast(GameEvents.HideInteractionUiEvent); - } + OnNearestInteractableChanged(_nearestInteractable); } - + if (_isInteracting) { - // 도중에 타겟이 바뀐 경우 초기화 if (_nearestInteractable != _interactingTarget) { - _isInteracting = false; - _interactHeldTime = 0f; - _interactingTarget = null; - - // UI 초기화 - if (_nearestInteractable != null && _nearestInteractable.CanInteract()) - { - BroadcastShowUi(_nearestInteractable, 0f); - } - + ResetInteractionState(); return; } @@ -67,109 +44,56 @@ private void Update() if (_interactHeldTime >= requiredHoldTime) { - ratio = 0f; _isInteracting = false; _interactingTarget.OnInteracted(this); _interactingTarget = null; + OnInteractionCompleted(); } - BroadcastShowUi(_interactingTarget, ratio); + OnInteractionHoldProgress(ratio); } } - private void OnDestroy() - { - EventBus.Unregister(this); + protected virtual void OnDestroy() { } - if (_restaurantPlayerDataSo) - { - _restaurantPlayerDataSo.InteractAction.performed -= OnInteractPerformed; - _restaurantPlayerDataSo.InteractAction.canceled -= OnInteractCanceled; - } - } + protected virtual void OnNearestInteractableChanged(IInteractable newTarget) { } + protected virtual void OnInteractionHoldProgress(float ratio) { } + protected virtual void OnInteractionCompleted() { } - private async Task Initialize() - { - _restaurantPlayerDataSo = await AssetManager.LoadAsset(DataConstants.RestaurantPlayerDataSo); - Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null"); - - _restaurantPlayerDataSo.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact)); - - _restaurantPlayerDataSo.InteractAction.performed += OnInteractPerformed; - _restaurantPlayerDataSo.InteractAction.canceled += OnInteractCanceled; - - EventBus.Register(this); - } - - public void Invoke(RestaurantInteractionEvent evt) - { - // TODO : 이벤트결과를 보고 할 일이 있다면 여기서 뭔가 처리. 기본적으로 이벤트에서 이미 인터페이스로 인터랙션 처리됨 - } - - public GameObject GetInteractorGameObject() - { - return gameObject; - } - - private void OnInteractPerformed(InputAction.CallbackContext context) - { - if (_nearestInteractable == null || _nearestInteractable.CanInteract() == false) return; - - float requiredHoldTime = _nearestInteractable.GetRequiredHoldTime(); - - if (requiredHoldTime <= 0f) - { - _nearestInteractable.OnInteracted(this); - } - else - { - _isInteracting = true; - _interactHeldTime = 0f; - _interactingTarget = _nearestInteractable; - } - } - - private void OnInteractCanceled(InputAction.CallbackContext context) + protected void ResetInteractionState() { _isInteracting = false; _interactHeldTime = 0f; + OnInteractionHoldProgress(0f); _interactingTarget = null; - - if (_nearestInteractable != null && _nearestInteractable.CanInteract()) - { - BroadcastShowUi(_nearestInteractable, 0f); - } } - private IInteractable GetNearestInteractable() + protected IInteractable GetNearestInteractable() { - int nearColliderCount = Physics.OverlapSphereNonAlloc(transform.position, _restaurantPlayerDataSo.InteractionRadius, - _nearColliders, _restaurantPlayerDataSo.InteractionLayerMask, QueryTriggerInteraction.Collide); + int nearColliderCount = Physics.OverlapSphereNonAlloc(transform.position, _interactionRadius, + _nearColliders, _interactionLayerMask, QueryTriggerInteraction.Collide); - IInteractable nearestInteractable = null; - float minDistance = float.MaxValue; + IInteractable nearest = null; + float minSqrDistance = float.MaxValue; for (int i = 0; i < nearColliderCount; i++) { var interactable = _nearColliders[i].GetComponent(); - if (interactable == null || interactable.CanInteract() == false) continue; - - float sqrMagnitude = (interactable.GetInteractableGameObject().transform.position - transform.position).sqrMagnitude; - if (sqrMagnitude > minDistance) continue; - - nearestInteractable = interactable; - minDistance = sqrMagnitude; + if (interactable == null || !interactable.CanInteract()) continue; + + float sqrDistance = (interactable.GetInteractableGameObject().transform.position - transform.position).sqrMagnitude; + if (sqrDistance < minSqrDistance) + { + minSqrDistance = sqrDistance; + nearest = interactable; + } } - - return nearestInteractable; - } - - private void BroadcastShowUi(IInteractable interactable, float ratio) - { - var evt = GameEvents.ShowInteractionUiEvent; - evt.TextKey = interactable.GetInteractionMessageKey(); - evt.HoldProgress = ratio; - EventBus.Broadcast(evt); + + return nearest; } + + public virtual void Invoke(RestaurantInteractionEvent evt) { } + + public GameObject GetInteractorGameObject() => gameObject; } -} \ No newline at end of file +} diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs new file mode 100644 index 000000000..aa886d0dd --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs @@ -0,0 +1,105 @@ +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.InputSystem; + +namespace DDD +{ + public class RestaurantPlayerInteraction : RestaurantCharacterInteraction + { + private RestaurantPlayerDataSo _restaurantPlayerDataSo; + + protected override void Start() + { + base.Start(); + + _ = Initialize(); + } + + private async Task Initialize() + { + _restaurantPlayerDataSo = await AssetManager.LoadAsset(DataConstants.RestaurantPlayerDataSo); + Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null"); + + _restaurantPlayerDataSo.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact)); + _restaurantPlayerDataSo.InteractAction.performed += OnInteractPerformed; + _restaurantPlayerDataSo.InteractAction.canceled += OnInteractCanceled; + + _interactionRadius = _restaurantPlayerDataSo.InteractionRadius; + _interactionLayerMask = _restaurantPlayerDataSo.InteractionLayerMask; + + EventBus.Register(this); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + + if (_restaurantPlayerDataSo != null) + { + _restaurantPlayerDataSo.InteractAction.performed -= OnInteractPerformed; + _restaurantPlayerDataSo.InteractAction.canceled -= OnInteractCanceled; + } + + EventBus.Unregister(this); + } + + private void OnInteractPerformed(InputAction.CallbackContext context) + { + if (_nearestInteractable == null || !_nearestInteractable.CanInteract()) return; + + float requiredHoldTime = _nearestInteractable.GetRequiredHoldTime(); + + if (requiredHoldTime <= 0f) + { + _nearestInteractable.OnInteracted(this); + } + else + { + _isInteracting = true; + _interactHeldTime = 0f; + _interactingTarget = _nearestInteractable; + } + } + + private void OnInteractCanceled(InputAction.CallbackContext context) + { + ResetInteractionState(); + } + + protected override void OnNearestInteractableChanged(IInteractable newTarget) + { + if (newTarget != null && newTarget.CanInteract()) + { + BroadcastShowUi(newTarget, 0f); + } + else + { + if (_isInteracting == false) + { + EventBus.Broadcast(GameEvents.HideInteractionUiEvent); + } + } + } + + protected override void OnInteractionHoldProgress(float ratio) + { + if (_interactingTarget != null) + { + BroadcastShowUi(_interactingTarget, ratio); + } + } + + protected override void OnInteractionCompleted() + { + + } + + private void BroadcastShowUi(IInteractable interactable, float ratio) + { + var evt = GameEvents.ShowInteractionUiEvent; + evt.TextKey = interactable.GetInteractionMessageKey(); + evt.HoldProgress = ratio; + EventBus.Broadcast(evt); + } + } +} \ No newline at end of file From b705d80ce5eb82e0c1e8977ef8fc53a0f6d1951c Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Wed, 6 Aug 2025 17:45:32 +0900 Subject: [PATCH 02/15] =?UTF-8?q?=EC=97=90=EC=85=8B=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=20=EC=9E=84=EC=8B=9C=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/CustomerCharacter.prefab | 91 +++++++++++++++++++ .../Prefabs/CustomerCharacter.prefab.meta | 7 ++ .../Prefabs/RestaurantPlayer.prefab | 30 +++--- .../Prefabs/BaseRestaurantCharacter.prefab | 21 +++++ .../_Scripts/RestaurantCharacter/Npc.meta | 8 ++ .../RestaurantCharacter/Npc/Customer.meta | 8 ++ .../Npc/Customer/CustomerCharacter.cs | 9 ++ .../Npc/Customer/CustomerCharacter.cs.meta | 2 + .../RestaurantPlayerInteraction.cs.meta | 2 + 9 files changed, 167 insertions(+), 11 deletions(-) create mode 100644 Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab create mode 100644 Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab new file mode 100644 index 000000000..31ce504ef --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3417590820015712106 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 500600556154722887, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: _initialSkinName + value: Casper + objectReference: {fileID: 0} + - target: {fileID: 1741467189652270979, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: initialSkinName + value: Casper + objectReference: {fileID: 0} + - target: {fileID: 1741467189652270979, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: skeletonDataAsset + value: + objectReference: {fileID: 11400000, guid: 90ef4d2128c770b4cb83806c33867a79, type: 2} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_Name + value: CustomerCharacter + objectReference: {fileID: 0} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_Materials.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[0]' + value: + objectReference: {fileID: 2100000, guid: b5430080246bbb048b939d6a0a5621cd, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[1]' + value: + objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[2]' + value: + objectReference: {fileID: 2100000, guid: 0bc9c8216989ef64ab468d6aa08cca35, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[3]' + value: + objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta b/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta new file mode 100644 index 000000000..92b055a42 --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ceeea618d8ee23642a0e56b3f963448c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab index 646a17c6c..6c9f1a2bb 100644 --- a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab @@ -250,6 +250,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 500600556154722887, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: _initialSkinName + value: Basic + objectReference: {fileID: 0} - target: {fileID: 1111036208394089843, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} propertyPath: m_LocalScale.x value: 2 @@ -325,6 +329,7 @@ PrefabInstance: m_RemovedComponents: - {fileID: 3365694194251356714, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + - {fileID: 7606279200344222219, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: - targetCorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} @@ -345,7 +350,7 @@ PrefabInstance: addedObject: {fileID: 5643954521731085080} - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} insertIndex: -1 - addedObject: {fileID: 1115647804376030753} + addedObject: {fileID: 388082324973004231} m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} --- !u!1 &7316134055819320434 stripped GameObject: @@ -388,7 +393,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d4e8820e36cdbec4fb86f9bc0e3fd638, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &1115647804376030753 +--- !u!114 &388082324973004231 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -397,17 +402,20 @@ MonoBehaviour: m_GameObject: {fileID: 7316134055819320434} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6d7e5480ae1ebf54b8537ad2a08696d2, type: 3} + m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3} m_Name: m_EditorClassIdentifier: - _originalMaterial: {fileID: 2100000, guid: 288333d9c9df2d84cadf3b48d918ebdb, type: 2} - _replacementMaterial: {fileID: 0} - _isSkinSet: 1 - _initialSkinName: Basic - _isRandomSkin: 0 - _isRandomRange: 0 - _randomRange: {x: 0, y: 0} - _randomStrings: [] + _nearColliders: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} --- !u!4 &7511707580127947132 stripped Transform: m_CorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} diff --git a/Assets/_DDD/_ScriptAssets/Prefabs/BaseRestaurantCharacter.prefab b/Assets/_DDD/_ScriptAssets/Prefabs/BaseRestaurantCharacter.prefab index fcc593f36..27469bbe8 100644 --- a/Assets/_DDD/_ScriptAssets/Prefabs/BaseRestaurantCharacter.prefab +++ b/Assets/_DDD/_ScriptAssets/Prefabs/BaseRestaurantCharacter.prefab @@ -47,6 +47,7 @@ GameObject: - component: {fileID: 127430239903465757} - component: {fileID: 3095965496140440094} - component: {fileID: 7606279200344222219} + - component: {fileID: 500600556154722887} m_Layer: 0 m_Name: BaseRestaurantCharacter m_TagString: Untagged @@ -177,6 +178,26 @@ MonoBehaviour: - {fileID: 0} - {fileID: 0} - {fileID: 0} +--- !u!114 &500600556154722887 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5259510642736920361} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d7e5480ae1ebf54b8537ad2a08696d2, type: 3} + m_Name: + m_EditorClassIdentifier: + _originalMaterial: {fileID: 0} + _replacementMaterial: {fileID: 0} + _isSkinSet: 1 + _initialSkinName: default + _isRandomSkin: 0 + _isRandomRange: 0 + _randomRange: {x: 0, y: 0} + _randomStrings: [] --- !u!1 &6791841979869644848 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta new file mode 100644 index 000000000..3d4acccb1 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9842fda5de8da1641ae1f8b12b0f030c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta new file mode 100644 index 000000000..a199e1e35 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05e79ebcdc69f7c43adbfbe42ebfbb83 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs new file mode 100644 index 000000000..77f409cd6 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace DDD +{ + public class CustomerCharacter : MonoBehaviour + { + + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta new file mode 100644 index 000000000..b7f59fb7f --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b242c4f65b2734841840c89dfab1500b \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta new file mode 100644 index 000000000..1d0deec52 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 81e01dd8c1cc3404d805400eba1bb4ae \ No newline at end of file From d930358fe53cb42125d7d3b02d0a7729d3809753 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Wed, 6 Aug 2025 17:58:45 +0900 Subject: [PATCH 03/15] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=B0=8F=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/AddressableAssetsData/AssetGroups/Group.asset | 6 ++++++ Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta | 8 ++++++++ .../{ => Player}/RestaurantPlayerCharacter.cs | 0 .../{ => Player}/RestaurantPlayerCharacter.cs.meta | 0 .../{ => Player}/RestaurantPlayerDataSo.cs | 0 .../{ => Player}/RestaurantPlayerDataSo.cs.meta | 0 .../{ => Player}/RestaurantPlayerInput.cs | 0 .../{ => Player}/RestaurantPlayerInput.cs.meta | 0 .../{ => Player}/RestaurantPlayerInteraction.cs | 0 .../{ => Player}/RestaurantPlayerInteraction.cs.meta | 0 .../{ => Player}/RestaurantPlayerMovement.cs | 0 .../{ => Player}/RestaurantPlayerMovement.cs.meta | 0 .../CreateRestaurantPlayerSo.cs | 0 .../CreateRestaurantPlayerSo.cs.meta | 0 14 files changed, 14 insertions(+) create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerCharacter.cs (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerCharacter.cs.meta (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerDataSo.cs (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerDataSo.cs.meta (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerInput.cs (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerInput.cs.meta (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerInteraction.cs (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerInteraction.cs.meta (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerMovement.cs (100%) rename Assets/_DDD/_Scripts/RestaurantCharacter/{ => Player}/RestaurantPlayerMovement.cs.meta (100%) rename Assets/_DDD/_Scripts/{RestaurantCharacter => RestaurantController}/CreateRestaurantPlayerSo.cs (100%) rename Assets/_DDD/_Scripts/{RestaurantCharacter => RestaurantController}/CreateRestaurantPlayerSo.cs.meta (100%) diff --git a/Assets/AddressableAssetsData/AssetGroups/Group.asset b/Assets/AddressableAssetsData/AssetGroups/Group.asset index d1044cd9d..7487769c9 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Group.asset @@ -169,6 +169,12 @@ MonoBehaviour: m_SerializedLabels: - Prefab FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: ceeea618d8ee23642a0e56b3f963448c + m_Address: CustomerCharacter + m_ReadOnly: 0 + m_SerializedLabels: + - Prefab + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: d11d5cf80be02d7469f07db925af284a m_Address: TabButtonUi m_ReadOnly: 0 diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta new file mode 100644 index 000000000..b6cf0c3d8 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a1d00dbfecd9c94d8eada9e9a0cf77f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerCharacter.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerCharacter.cs rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerCharacter.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerCharacter.cs.meta rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerDataSo.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerDataSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerDataSo.cs rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerDataSo.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerDataSo.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerDataSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerDataSo.cs.meta rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerDataSo.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInput.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInput.cs rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInput.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInput.cs.meta rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerInteraction.cs.meta rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantPlayerMovement.cs.meta rename to Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayerSo.cs b/Assets/_DDD/_Scripts/RestaurantController/CreateRestaurantPlayerSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayerSo.cs rename to Assets/_DDD/_Scripts/RestaurantController/CreateRestaurantPlayerSo.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayerSo.cs.meta b/Assets/_DDD/_Scripts/RestaurantController/CreateRestaurantPlayerSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/CreateRestaurantPlayerSo.cs.meta rename to Assets/_DDD/_Scripts/RestaurantController/CreateRestaurantPlayerSo.cs.meta From 52881e4d7531ea4f83bf37dead9fd6916092b761 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Wed, 6 Aug 2025 18:58:03 +0900 Subject: [PATCH 04/15] =?UTF-8?q?AiMovement=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RestaurantCharacter/IAiMovement.cs | 26 ++++ .../Npc/RestaurantNpcMovement.cs | 146 ++++++++++++++++++ .../Player/RestaurantPlayerMovement.cs | 4 +- .../RestaurantCharacterMovement.cs | 2 +- 4 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs new file mode 100644 index 000000000..0b7eed70e --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace DDD +{ + public interface IAiMovement + { + Vector3 CurrentPosition { get; } + Vector3 Destination { get; } + float CurrentSpeed { get; } + bool IsMoving { get; } + + void EnableMove(); + void DisableMove(); + void PlayMove(); + void StopMove(); + void SetMoveSpeed(float speed); + + bool TryMoveToPosition(Vector3 position); + bool TryMoveToTarget(Collider targetCollider); + Vector3 GetRandomBetweenTwoPoints(Vector2? normalizedRange = null); + bool TryTeleportToPosition(Vector3 position); + bool HasReachedDestination(); + bool IsPositionMovable(Vector3 endPosition); + bool TryMoveToRandomPositionInRange(float range, int graphIndex = 0); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs new file mode 100644 index 000000000..64a0f0590 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs @@ -0,0 +1,146 @@ +using Pathfinding; +using UnityEngine; + +namespace DDD +{ + public class RestaurantNpcMovement : RestaurantCharacterMovement, IAiMovement + { + private IAstarAI _iAstarAi; + + protected override void Awake() + { + base.Awake(); + + _iAstarAi = GetComponent(); + Debug.Assert(_iAstarAi != null, "_iAstarAi is null"); + } + + private const int MaxRandomMoveAttempts = 1000; + + public Vector3 CurrentPosition => _iAstarAi.position; + public Vector3 Destination => _iAstarAi.destination; + public float CurrentSpeed => _iAstarAi.velocity.magnitude; + public bool IsMoving => !_iAstarAi.isStopped && _iAstarAi.hasPath; + + public void EnableMove() + { + _iAstarAi.canMove = true; + } + + public void DisableMove() + { + _iAstarAi.canMove = false; + } + + public void PlayMove() + { + _iAstarAi.isStopped = false; + } + + public void StopMove() + { + _iAstarAi.isStopped = true; + _iAstarAi.SetPath(null); + } + + public void SetMoveSpeed(float speed) + { + _iAstarAi.maxSpeed = speed; + } + + public bool TryMoveToPosition(Vector3 position) + { + if (IsPositionMovable(position) == false) + { + Debug.LogWarning($"{gameObject.name}이 이동 불가능한 위치를 대상으로 이동을 시도함"); + return false; + } + + _iAstarAi.destination = position; + PlayMove(); + return true; + } + + public bool TryMoveToTarget(Collider targetCollider) + { + if (targetCollider == null) + { + Debug.LogWarning($"{gameObject.name}이 이동하려는 타겟을 찾지 못함"); + StopMove(); + return false; + } + + return TryMoveToPosition(targetCollider.transform.position); + } + + public Vector3 GetRandomBetweenTwoPoints(Vector2? normalizedRange = null) + { + var range = normalizedRange ?? new Vector2(0.2f, 0.8f); + var randomFactor = Random.Range(range.x, range.y); + return Vector3.Lerp(_iAstarAi.position, _iAstarAi.destination, randomFactor); + } + + public bool TryTeleportToPosition(Vector3 position) + { + if (IsPositionMovable(position) == false) + { + Debug.LogWarning($"{gameObject.name}오브젝트가 이동 불가능한 위치로 텔레포트 시도됨"); + return false; + } + + _iAstarAi.Teleport(position); + return true; + } + + public bool HasReachedDestination() + { + return _iAstarAi.pathPending == false && _iAstarAi.reachedEndOfPath; + } + + public bool IsPositionMovable(Vector3 endPosition) + { + var nearestNode = AstarPath.active.GetNearest(endPosition).node; + return nearestNode != null && nearestNode.Walkable; + } + + public bool TryMoveToRandomPositionInRange(float range, int graphIndex = 0) + { + if (graphIndex < 0 || graphIndex >= AstarPath.active.graphs.Length) + { + Debug.LogWarning($"{gameObject.name} - 유효하지 않은 그래프 인덱스: {graphIndex}"); + return false; + } + + int attempts = 0; + Vector3 randomPosition; + var isMovable = false; + var graphBounds = AstarPath.active.graphs[graphIndex].bounds; + + do + { + var randomDirection = Random.insideUnitCircle.normalized; + var randomOffset = new Vector3(randomDirection.x, 0, randomDirection.y) * Random.Range(0, range); + + randomPosition = _iAstarAi.position + randomOffset; + if (!graphBounds.Contains(randomPosition)) + { + continue; + } + + isMovable = IsPositionMovable(randomPosition); + + attempts++; + } while (!isMovable && attempts < MaxRandomMoveAttempts); + + if (isMovable == false) + { + Debug.LogWarning($"{gameObject.name}오브젝트의 랜덤 위치 탐색 실패"); + return false; + } + + _iAstarAi.destination = randomPosition; + PlayMove(); + return true; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs index 9a3c14013..0ec205d5f 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs @@ -35,8 +35,10 @@ public class RestaurantPlayerMovement : RestaurantCharacterMovement #region Unity Lifecycle - private void Awake() + protected override void Awake() { + base.Awake(); + InitializeComponents(); } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterMovement.cs index 3493afb94..19920b0b2 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterMovement.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterMovement.cs @@ -5,7 +5,7 @@ namespace DDD public class RestaurantCharacterMovement : MonoBehaviour { private RestaurantCharacterMovementConstraint _constraint; - private void Awake() + protected virtual void Awake() { _constraint = gameObject.AddComponent(); } From 1a48a45683f843eefc7edb7b2fd05bc2bf6fe6a9 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Wed, 6 Aug 2025 18:58:09 +0900 Subject: [PATCH 05/15] =?UTF-8?q?=EC=97=90=EC=85=8B=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetGroups/Group.asset | 8 +- .../Prefabs/CustomerCharacter.prefab | 91 ------- .../_Addressables/Prefabs/CustomerNpc.prefab | 59 +++++ .../Prefabs/CustomerNpc.prefab.meta | 7 + .../Prefabs/RestaurantNpc.prefab | 243 ++++++++++++++++++ ....prefab.meta => RestaurantNpc.prefab.meta} | 0 .../RestaurantCharacter/IAiMovement.cs.meta | 3 + .../Npc/RestaurantNpcMovement.cs.meta | 2 + 8 files changed, 321 insertions(+), 92 deletions(-) delete mode 100644 Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab create mode 100644 Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab create mode 100644 Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab.meta create mode 100644 Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab rename Assets/_DDD/_Addressables/Prefabs/{CustomerCharacter.prefab.meta => RestaurantNpc.prefab.meta} (100%) create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs.meta create mode 100644 Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta diff --git a/Assets/AddressableAssetsData/AssetGroups/Group.asset b/Assets/AddressableAssetsData/AssetGroups/Group.asset index 7487769c9..79be66f73 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Group.asset @@ -73,6 +73,12 @@ MonoBehaviour: m_SerializedLabels: - Scene FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: 3d9cd4966de6ad949b6c2f3289f681ce + m_Address: CustomerNpc + m_ReadOnly: 0 + m_SerializedLabels: + - Prefab + FlaggedDuringContentUpdateRestriction: 0 - m_GUID: 422e501a9731145439708c6759c8c546 m_Address: Coral_SkeletonData m_ReadOnly: 0 @@ -170,7 +176,7 @@ MonoBehaviour: - Prefab FlaggedDuringContentUpdateRestriction: 0 - m_GUID: ceeea618d8ee23642a0e56b3f963448c - m_Address: CustomerCharacter + m_Address: RestaurantNpc m_ReadOnly: 0 m_SerializedLabels: - Prefab diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab deleted file mode 100644 index 31ce504ef..000000000 --- a/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab +++ /dev/null @@ -1,91 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &3417590820015712106 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 500600556154722887, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: _initialSkinName - value: Casper - objectReference: {fileID: 0} - - target: {fileID: 1741467189652270979, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: initialSkinName - value: Casper - objectReference: {fileID: 0} - - target: {fileID: 1741467189652270979, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: skeletonDataAsset - value: - objectReference: {fileID: 11400000, guid: 90ef4d2128c770b4cb83806c33867a79, type: 2} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_Name - value: CustomerCharacter - objectReference: {fileID: 0} - - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: m_Materials.Array.size - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: 'm_Materials.Array.data[0]' - value: - objectReference: {fileID: 2100000, guid: b5430080246bbb048b939d6a0a5621cd, type: 2} - - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: 'm_Materials.Array.data[1]' - value: - objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} - - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: 'm_Materials.Array.data[2]' - value: - objectReference: {fileID: 2100000, guid: 0bc9c8216989ef64ab468d6aa08cca35, type: 2} - - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - propertyPath: 'm_Materials.Array.data[3]' - value: - objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab new file mode 100644 index 000000000..7b33689ef --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab @@ -0,0 +1,59 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &6675463944788402332 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3971935000603232885, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: m_Name + value: RestaurantNpc + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab.meta b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab.meta new file mode 100644 index 000000000..ee976fbfd --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3d9cd4966de6ad949b6c2f3289f681ce +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab new file mode 100644 index 000000000..5bc52b30e --- /dev/null +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab @@ -0,0 +1,243 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &3417590820015712106 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_Name + value: RestaurantNpc + objectReference: {fileID: 0} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: m_Materials.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[0]' + value: + objectReference: {fileID: 2100000, guid: b5430080246bbb048b939d6a0a5621cd, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[1]' + value: + objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[2]' + value: + objectReference: {fileID: 2100000, guid: 0bc9c8216989ef64ab468d6aa08cca35, type: 2} + - target: {fileID: 8683566178618629536, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: 'm_Materials.Array.data[3]' + value: + objectReference: {fileID: 2100000, guid: d018debe5b8bedf4c8f19cba9e4facec, type: 2} + m_RemovedComponents: + - {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + insertIndex: 3 + addedObject: {fileID: 8165702938223525558} + - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + insertIndex: 4 + addedObject: {fileID: 5654854357519457123} + - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + insertIndex: 5 + addedObject: {fileID: 325877664603524396} + - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + insertIndex: 6 + addedObject: {fileID: 6826437533270866908} + - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + insertIndex: -1 + addedObject: {fileID: 8626078465432105892} + m_SourcePrefab: {fileID: 100100000, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} +--- !u!1 &7462519206451630147 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + m_PrefabInstance: {fileID: 3417590820015712106} + m_PrefabAsset: {fileID: 0} +--- !u!114 &8165702938223525558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7462519206451630147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 373b52eb9bf8c40f785bb6947a1aee66, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1073741824 + drawGizmos: 1 + detailedGizmos: 0 + startEndModifier: + addPoints: 0 + exactStartPoint: 3 + exactEndPoint: 3 + useRaycasting: 0 + mask: + serializedVersion: 2 + m_Bits: 4294967295 + useGraphRaycasting: 0 + traversableTags: -1 + tagPenalties: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + graphMask: + value: 1 +--- !u!114 &5654854357519457123 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7462519206451630147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f6eb1402c17e84a9282a7f0f62eb584f, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1073741824 + radius: 0.25 + height: 0.5 + canMove: 1 + maxSpeed: 2 + gravity: {x: NaN, y: NaN, z: NaN} + groundMask: + serializedVersion: 2 + m_Bits: 4294967295 + endReachedDistance: 0.2 + whenCloseToDestination: 0 + rvoDensityBehavior: + enabled: 1 + densityThreshold: 0.5 + returnAfterBeingPushedAway: 0 + progressAverage: 0 + lastJobDensityResult: 0 + repathRateCompatibility: NaN + canSearchCompability: 0 + orientation: 0 + enableRotation: 0 + autoRepath: + mode: 2 + period: 0.5 + sensitivity: 10 + maximumPeriod: 2 + visualizeSensitivity: 0 + maxAcceleration: -2.5 + rotationSpeed: 360 + slowdownDistance: 1 + pickNextWaypointDist: 0.2 + alwaysDrawGizmos: 0 + slowWhenNotFacingTarget: 1 + preventMovingBackwards: 0 + constrainInsideGraph: 0 +--- !u!114 &325877664603524396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7462519206451630147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 77f586f285b3847808d79083bd19ef1f, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1073741824 + quality: 0 + splitAtEveryPortal: 0 + accountForGridPenalties: 0 +--- !u!114 &6826437533270866908 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7462519206451630147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8d7b55c7ecdb49a4a89fa5e6f9022861, type: 3} + m_Name: + m_EditorClassIdentifier: + startWhenEnabled: 0 + asynchronousLoad: 0 + pauseWhenDisabled: 0 + restartWhenComplete: 0 + logTaskChanges: 0 + group: 0 + resetValuesOnRestart: 0 + externalBehavior: {fileID: 0} + mBehaviorSource: + behaviorName: Behavior + behaviorDescription: + mTaskData: + types: [] + parentIndex: + startIndex: + variableStartIndex: + JSONSerialization: + fieldSerializationData: + typeName: [] + fieldNameHash: + startIndex: + dataPosition: + unityObjects: [] + byteData: + byteDataArray: + Version: + gizmoViewMode: 2 + showBehaviorDesignerGizmo: 1 +--- !u!114 &8626078465432105892 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7462519206451630147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bb787bf70c7c134d9a6a049beb7f66a, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta b/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab.meta similarity index 100% rename from Assets/_DDD/_Addressables/Prefabs/CustomerCharacter.prefab.meta rename to Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs.meta new file mode 100644 index 000000000..b138eabb2 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/IAiMovement.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 466c0e7347f54d359d083fa944e17a1d +timeCreated: 1754473944 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta new file mode 100644 index 000000000..30ec96dae --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8bb787bf70c7c134d9a6a049beb7f66a \ No newline at end of file From a778a9d58c898a35c29332d3d88a84773af3f7b5 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:11:39 +0900 Subject: [PATCH 06/15] =?UTF-8?q?=EC=83=81=ED=98=B8=EC=9E=91=EC=9A=A9=20so?= =?UTF-8?q?lver=20=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=EC=97=90?= =?UTF-8?q?=20CanInteract=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/GameEvent/IInteractable.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs index e24b03898..09ad1dd15 100644 --- a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs +++ b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs @@ -26,5 +26,6 @@ public interface IInteractor public interface IInteractionSolver { bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null); + bool CanInteract(); } } From a265bd3440a9d0914b8e1f85e356fe63eac245e2 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:12:02 +0900 Subject: [PATCH 07/15] =?UTF-8?q?solver=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EC=98=A4=ED=94=88=20=EB=A0=88=EC=8A=A4=ED=86=A0=EB=9E=91=20?= =?UTF-8?q?solver=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RestaurantManagementUiEventSolver.cs | 10 +++++++-- .../RestaurantOpenEventSolver.cs | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs index 50f1c83ef..751a9fdfb 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs @@ -6,12 +6,18 @@ public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolv { public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) { - GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; - if (currentGameFlowState != GameFlowState.ReadyForRestaurant) return false; + if (CanInteract() == false) return false; + var evt = GameEvents.OpenPopupUiEvent; evt.UiType = typeof(RestaurantManagementUi); EventBus.Broadcast(evt); return true; } + + public bool CanInteract() + { + GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; + return currentGameFlowState == GameFlowState.ReadyForRestaurant; + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs new file mode 100644 index 000000000..68c499998 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace DDD +{ + public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver + { + public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) + { + if (CanInteract() == false) return false; + + GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant); + return true; + } + + public bool CanInteract() + { + GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; + return currentGameFlowState == GameFlowState.ReadyForRestaurant; + } + } +} \ No newline at end of file From 7ef7b33bd936dbc7245a2451c6ef668915e7d94c Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:12:11 +0900 Subject: [PATCH 08/15] =?UTF-8?q?=EB=A9=94=ED=83=80=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs.meta | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs.meta b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs.meta new file mode 100644 index 000000000..26d2cff63 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 713ef022896503d459489d3dfa119f04 +timeCreated: 1753179809 From 64773e80d831bb438e4483855fd653994d56b88e Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:15:52 +0900 Subject: [PATCH 09/15] =?UTF-8?q?todo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs index 68c499998..b6b5dd398 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs @@ -14,6 +14,8 @@ public bool ExecuteInteraction(IInteractor interactor, IInteractable interactabl public bool CanInteract() { + // TODO : 영업 가능한 상태인지 조건 추가 (최소 요리, 요리도구 배치 등) + GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; return currentGameFlowState == GameFlowState.ReadyForRestaurant; } From 2ef865e11f3a9aa1288b3920c0803de7394fa447 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:16:10 +0900 Subject: [PATCH 10/15] =?UTF-8?q?=EA=B3=B5=EC=9A=A9=20npc=20=EC=9B=80?= =?UTF-8?q?=EC=A7=81=EC=9E=84=20=ED=82=84=EB=9E=98=EC=8A=A4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Npc/RestaurantNpcMovement.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs index 64a0f0590..1e691ffd3 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs @@ -7,6 +7,13 @@ public class RestaurantNpcMovement : RestaurantCharacterMovement, IAiMovement { private IAstarAI _iAstarAi; + private const int MaxRandomMoveAttempts = 1000; + + public Vector3 CurrentPosition => _iAstarAi.position; + public Vector3 Destination => _iAstarAi.destination; + public float CurrentSpeed => _iAstarAi.velocity.magnitude; + public bool IsMoving => !_iAstarAi.isStopped && _iAstarAi.hasPath; + protected override void Awake() { base.Awake(); @@ -14,13 +21,6 @@ protected override void Awake() _iAstarAi = GetComponent(); Debug.Assert(_iAstarAi != null, "_iAstarAi is null"); } - - private const int MaxRandomMoveAttempts = 1000; - - public Vector3 CurrentPosition => _iAstarAi.position; - public Vector3 Destination => _iAstarAi.destination; - public float CurrentSpeed => _iAstarAi.velocity.magnitude; - public bool IsMoving => !_iAstarAi.isStopped && _iAstarAi.hasPath; public void EnableMove() { From 9fc80f90172c9e7af6994b3f5e0a8450929ef06b Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:16:25 +0900 Subject: [PATCH 11/15] =?UTF-8?q?so=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Scripts/GameState/RestaurantManagementSo.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs index 2a1bf989c..2dc40859a 100644 --- a/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs +++ b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using Sirenix.OdinInspector; @@ -11,8 +10,6 @@ public class RestaurantManagementSo : GameFlowTask { // TODO : 체크리스트 기능 - // TODO : 조리도구 등록, 해제 기능 - public ItemSlotUi ItemSlotUiPrefab; [Title("선택된 메뉴 상세 내용")] @@ -37,13 +34,21 @@ public class RestaurantManagementSo : GameFlowTask public IReadOnlyList TodayCookwareIds => _todayCookwareIds; public override Task OnReadyNewFlow(GameFlowState newFlowState) + { + if (newFlowState == GameFlowState.ReadyForRestaurant) + { + InitializeReadyForRestaurant(); + } + + return Task.CompletedTask; + } + + private void InitializeReadyForRestaurant() { _todayFoodRecipeIds.Clear(); _todayDrinkRecipeIds.Clear(); _todayWorkerIds.Clear(); _todayCookwareIds.Clear(); - - return Task.CompletedTask; } public bool TryAddTodayMenu(ItemSlotUi itemSlotUi) From 78ca575910904f3f7aeab1e10ea4c6b0f62d2a8e Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:16:30 +0900 Subject: [PATCH 12/15] =?UTF-8?q?=ED=94=84=EB=A6=AC=ED=8C=B9=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab index 5bc52b30e..de87b71ab 100644 --- a/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantNpc.prefab @@ -8,6 +8,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 500600556154722887, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} + propertyPath: _initialSkinName + value: Casper + objectReference: {fileID: 0} - target: {fileID: 1761643478070701343, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} propertyPath: m_LocalPosition.x value: 0 From f02fe591dc9a9128e460efb136889c0d81b7e3a9 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 17:51:36 +0900 Subject: [PATCH 13/15] =?UTF-8?q?=EC=83=81=ED=98=B8=EC=9E=91=EC=9A=A9=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_DDD/_Scripts/GameEvent/IInteractable.cs | 5 +- .../Player/RestaurantPlayerInteraction.cs | 6 +-- .../RestaurantCharacterInteraction.cs | 47 +++++++++++++------ .../RestaurantInteractionEvents.cs | 3 +- .../RestaurantManagementUiEventSolver.cs | 4 +- .../RestaurantOpenEventSolver.cs | 21 +++++++-- 6 files changed, 58 insertions(+), 28 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs index 09ad1dd15..dbb465fa8 100644 --- a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs +++ b/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs @@ -4,8 +4,9 @@ namespace DDD { public enum InteractionType { - None, + None = 0, RestaurantManagementUi, + OpenRestaurant, Count } public interface IInteractable @@ -26,6 +27,6 @@ public interface IInteractor public interface IInteractionSolver { bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null); - bool CanInteract(); + bool CanExecuteInteraction(); } } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs index aa886d0dd..5b86b5206 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs @@ -63,6 +63,7 @@ private void OnInteractPerformed(InputAction.CallbackContext context) private void OnInteractCanceled(InputAction.CallbackContext context) { + OnInteractionHoldProgress(0f); ResetInteractionState(); } @@ -74,10 +75,7 @@ protected override void OnNearestInteractableChanged(IInteractable newTarget) } else { - if (_isInteracting == false) - { - EventBus.Broadcast(GameEvents.HideInteractionUiEvent); - } + EventBus.Broadcast(GameEvents.HideInteractionUiEvent); } } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs index 014f8acd4..f706014b9 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs +++ b/Assets/_DDD/_Scripts/RestaurantCharacter/RestaurantCharacterInteraction.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Sirenix.OdinInspector; using UnityEngine; @@ -16,6 +17,7 @@ public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEvent protected float _interactionRadius = 1f; protected LayerMask _interactionLayerMask = (LayerMask)(-1); + private Dictionary _cachedSolvers = new(); protected virtual void Start() { } @@ -63,37 +65,54 @@ protected virtual void OnInteractionCompleted() { } protected void ResetInteractionState() { _isInteracting = false; + _interactingTarget = null; _interactHeldTime = 0f; OnInteractionHoldProgress(0f); - _interactingTarget = null; } protected IInteractable GetNearestInteractable() { - int nearColliderCount = Physics.OverlapSphereNonAlloc(transform.position, _interactionRadius, - _nearColliders, _interactionLayerMask, QueryTriggerInteraction.Collide); + int colliderCount = Physics.OverlapSphereNonAlloc(transform.position, _interactionRadius, _nearColliders, _interactionLayerMask); + float closestDistance = float.MaxValue; + IInteractable closest = null; - IInteractable nearest = null; - float minSqrDistance = float.MaxValue; - - for (int i = 0; i < nearColliderCount; i++) + for (int i = 0; i < colliderCount; i++) { - var interactable = _nearColliders[i].GetComponent(); - if (interactable == null || !interactable.CanInteract()) continue; + var col = _nearColliders[i]; + if (col.TryGetComponent(out var interactable) == false || interactable.CanInteract() == false) continue; - float sqrDistance = (interactable.GetInteractableGameObject().transform.position - transform.position).sqrMagnitude; - if (sqrDistance < minSqrDistance) + var type = interactable.GetInteractionType(); + if (ContainTypeToSolver(type, out var solver) == false || solver.CanExecuteInteraction() == false) continue; + + float distance = Vector3.Distance(transform.position, col.transform.position); + if (distance < closestDistance) { - minSqrDistance = sqrDistance; - nearest = interactable; + closestDistance = distance; + closest = interactable; } } - return nearest; + return closest; } public virtual void Invoke(RestaurantInteractionEvent evt) { } public GameObject GetInteractorGameObject() => gameObject; + + private bool ContainTypeToSolver(InteractionType type, out IInteractionSolver solver) + { + if (_cachedSolvers.TryGetValue(type, out solver)) return solver != null; + + solver = null; + + if (!RestaurantInteractionEventSolvers.TypeToSolver.TryGetValue(type, out var solverType)) return false; + + if (!TryGetComponent(solverType, out var component)) return false; + + solver = component as IInteractionSolver; + _cachedSolvers[type] = solver; + + return solver != null; + } } } diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs index c69a58221..2f86f12c3 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs @@ -13,7 +13,8 @@ public static class RestaurantInteractionEventSolvers { public static Dictionary TypeToSolver = new() { - {InteractionType.RestaurantManagementUi, typeof(RestaurantManagementUiEventSolver)} + {InteractionType.RestaurantManagementUi, typeof(RestaurantManagementUiEventSolver)}, + {InteractionType.OpenRestaurant, typeof(RestaurantOpenEventSolver)} }; } diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs index 751a9fdfb..6407cdb0e 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs @@ -6,7 +6,7 @@ public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolv { public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) { - if (CanInteract() == false) return false; + if (CanExecuteInteraction() == 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 CanInteract() + public bool CanExecuteInteraction() { GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; return currentGameFlowState == GameFlowState.ReadyForRestaurant; diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs index b6b5dd398..0ea0c75fa 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs @@ -1,23 +1,34 @@ +using System.Threading.Tasks; using UnityEngine; namespace DDD { public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver { + private RestaurantManagementSo _restaurantManagementSo; + + private void Start() + { + _ = Initialize(); + } + + private async Task Initialize() + { + _restaurantManagementSo = await AssetManager.LoadAsset(DataConstants.RestaurantManagementSo); + } + public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) { - if (CanInteract() == false) return false; + if (CanExecuteInteraction() == false) return false; GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant); return true; } - public bool CanInteract() + public bool CanExecuteInteraction() { - // TODO : 영업 가능한 상태인지 조건 추가 (최소 요리, 요리도구 배치 등) - GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; - return currentGameFlowState == GameFlowState.ReadyForRestaurant; + return currentGameFlowState == GameFlowState.ReadyForRestaurant && _restaurantManagementSo.IsOpenable(); } } } \ No newline at end of file From 26cd093313a22c3c03143b8bb50f5262b750ad2e Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 17:52:45 +0900 Subject: [PATCH 14/15] =?UTF-8?q?RestaurantManagementUi=20=EC=83=81?= =?UTF-8?q?=ED=98=B8=EC=9E=91=EC=9A=A9=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/GameEvent/GameEvents.cs | 2 +- .../GameState/RestaurantManagementSo.cs | 109 +++++++++++++----- .../InventoryUi/InventorySlotUiStrategy.cs | 7 +- .../InventoryUi/InventoryView.cs | 12 +- .../ItemUi/IItemSlotUiStrategy.cs | 2 +- .../ItemUi/ItemSlotUi.cs | 2 +- .../RestaurantManagementUi.cs | 11 +- .../TodayMenuInteractorStrategy.cs | 4 +- .../TodayMenuUi/TodayMenuSlotUiStrategy.cs | 17 ++- .../TodayCookwareInteractorStrategy.cs | 4 +- .../TodayCookwareSlotUiStrategy.cs | 7 +- .../TodayRestaurantStateView.cs | 2 +- .../TodayWorkerSlotUiStrategy.cs | 7 +- 13 files changed, 128 insertions(+), 58 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs index 364e9580a..50aa2a319 100644 --- a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs @@ -98,7 +98,7 @@ public class TodayMenuAddedEvent : IEvent {} public class TodayMenuRemovedEvent : IEvent { - public RecipeType RecipeType; + public InventoryCategoryType InventoryCategoryType; } #endregion diff --git a/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs index 2dc40859a..3f40aad3d 100644 --- a/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs +++ b/Assets/_DDD/_Scripts/GameState/RestaurantManagementSo.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Sirenix.OdinInspector; using UnityEngine; @@ -26,12 +27,12 @@ public class RestaurantManagementSo : GameFlowTask [ReadOnly, ShowInInspector] private Dictionary _todayFoodRecipeIds = new(); [ReadOnly, ShowInInspector] private Dictionary _todayDrinkRecipeIds = new(); [ReadOnly, ShowInInspector] private List _todayWorkerIds = new(); - [ReadOnly, ShowInInspector] private List _todayCookwareIds = new(); + [ReadOnly, ShowInInspector] private Dictionary> _cookwareToRecipeIds = new(); public IReadOnlyDictionary TodayFoodRecipeIds => _todayFoodRecipeIds; public IReadOnlyDictionary TodayDrinkRecipeIds => _todayDrinkRecipeIds; public IReadOnlyList TodayWorkerIds => _todayWorkerIds; - public IReadOnlyList TodayCookwareIds => _todayCookwareIds; + public IReadOnlyDictionary> CookwareToRecipeIds => _cookwareToRecipeIds; public override Task OnReadyNewFlow(GameFlowState newFlowState) { @@ -48,16 +49,25 @@ private void InitializeReadyForRestaurant() _todayFoodRecipeIds.Clear(); _todayDrinkRecipeIds.Clear(); _todayWorkerIds.Clear(); - _todayCookwareIds.Clear(); + _cookwareToRecipeIds.Clear(); } - public bool TryAddTodayMenu(ItemSlotUi itemSlotUi) + public bool IsOpenable() { - string recipeId = itemSlotUi.Model.Id; + // TODO : 영업 가능한 상태인지 조건 추가 (최소 요리, 요리도구 배치 등) + bool isExistedCookware = CookwareToRecipeIds.Count > 0; + bool isExistedMatchedMenu = _cookwareToRecipeIds.Values.Any(recipeSet => recipeSet is { Count: > 0 }); - if (itemSlotUi.Model.ItemType != ItemType.Recipe) return false; + return isExistedCookware && isExistedMatchedMenu; + } - if (!DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData)) return false; + public bool TryAddTodayMenu(ItemViewModel model) + { + string recipeId = model.Id; + + if (model.ItemType != ItemType.Recipe) return false; + + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData) == false) return false; bool added = false; @@ -86,18 +96,24 @@ public bool TryAddTodayMenu(ItemSlotUi itemSlotUi) if (added) { + var cookwareKey = GetRequiredCookwareKey(recipeId); + if (string.IsNullOrWhiteSpace(cookwareKey) == false && _cookwareToRecipeIds.TryGetValue(cookwareKey, out var recipeSet)) + { + recipeSet.Add(recipeId); + } + EventBus.Broadcast(RestaurantEvents.TodayMenuAddedEvent); } return added; } - public bool TryRemoveTodayMenu(ItemSlotUi itemSlotUi) + public bool TryRemoveTodayMenu(ItemViewModel model) { - string recipeId = itemSlotUi.Model.Id; + string recipeId = model.Id; var evt = RestaurantEvents.TodayMenuRemovedEvent; - if (!DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData)) return false; + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData) == false) return false; bool removed = false; int refundCount = 0; @@ -107,7 +123,7 @@ public bool TryRemoveTodayMenu(ItemSlotUi itemSlotUi) if (_todayFoodRecipeIds.TryGetValue(recipeId, out refundCount)) { removed = _todayFoodRecipeIds.Remove(recipeId); - evt.RecipeType = RecipeType.FoodRecipe; + evt.InventoryCategoryType = InventoryCategoryType.Food; if (removed) { @@ -121,7 +137,7 @@ public bool TryRemoveTodayMenu(ItemSlotUi itemSlotUi) if (_todayDrinkRecipeIds.TryGetValue(recipeId, out refundCount)) { removed = _todayDrinkRecipeIds.Remove(recipeId); - evt.RecipeType = RecipeType.DrinkRecipe; + evt.InventoryCategoryType = InventoryCategoryType.Drink; if (removed) { @@ -131,39 +147,78 @@ public bool TryRemoveTodayMenu(ItemSlotUi itemSlotUi) } } - if (!removed) return false; + if (removed) + { + var cookwareKey = GetRequiredCookwareKey(recipeId); + if (string.IsNullOrWhiteSpace(cookwareKey) == false && _cookwareToRecipeIds.TryGetValue(cookwareKey, out var recipeSet)) + { + recipeSet.Remove(recipeId); + } - EventBus.Broadcast(evt); - return true; + EventBus.Broadcast(evt); + } + + return removed; } - public bool TryAddTodayCookware(ItemSlotUi itemSlotUi) + public bool TryAddTodayCookware(ItemViewModel model) { - var itemId = itemSlotUi.Model.Id; + var cookwareId = model.Id; - if (itemSlotUi.Model.Count <= 0 || DataManager.Instance.GetDataSo().TryGetDataById(itemId, out CookwareData cookwareData) == false) return false; + if (model.HasItem == false || DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; - if (_todayCookwareIds.Count >= MaxCookwareCount || _todayCookwareIds.Contains(itemId)) return false; - - _todayCookwareIds.Add(itemId); + if (_cookwareToRecipeIds.Count >= MaxCookwareCount || _cookwareToRecipeIds.ContainsKey(cookwareId)) return false; + + _cookwareToRecipeIds[cookwareId] = new HashSet(); + + foreach (var recipeId in _todayFoodRecipeIds.Keys.Concat(_todayDrinkRecipeIds.Keys)) + { + var required = GetRequiredCookwareKey(recipeId); + if (required == cookwareId) + { + _cookwareToRecipeIds[cookwareId].Add(recipeId); + } + } + EventBus.Broadcast(RestaurantEvents.TodayMenuAddedEvent); return true; } + + public bool IsContainTodayMenu(string recipeId)=> _todayFoodRecipeIds.ContainsKey(recipeId) || _todayDrinkRecipeIds.ContainsKey(recipeId); - public bool TryRemoveTodayCookware(ItemSlotUi itemSlotUi) + public bool TryRemoveTodayCookware(ItemViewModel model) { - var itemId = itemSlotUi.Model.Id; + var cookwareId = model.Id; - if (DataManager.Instance.GetDataSo().TryGetDataById(itemId, out CookwareData cookwareData) == false) return false; + if (DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; - if (_todayCookwareIds.Remove(itemId) == false) return false; + if (_cookwareToRecipeIds.Remove(cookwareId) == false) return false; - EventBus.Broadcast( RestaurantEvents.TodayMenuRemovedEvent); + var evt = RestaurantEvents.TodayMenuRemovedEvent; + evt.InventoryCategoryType = InventoryCategoryType.Cookware; + EventBus.Broadcast(evt); return true; } + + private string GetRequiredCookwareKey(string recipeId) + { + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out var recipeData) == false) return null; - public bool IsContainTodayMenu(string recipeId)=> _todayFoodRecipeIds.ContainsKey(recipeId) || _todayDrinkRecipeIds.ContainsKey(recipeId); + var resultKey = recipeData.RecipeResult; + + return recipeData.RecipeType switch + { + RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + _ => null + }; + } + + public bool IsCookwareMatched(string recipeId) + { + return _cookwareToRecipeIds.Values.Any(recipeHashSets => recipeHashSets.Contains(recipeId)); + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs index b9b9cc6ec..17570e58b 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs @@ -7,7 +7,7 @@ public class InventorySlotUiStrategy : IItemSlotUiStrategy { public string AnimatorControllerKey => "InventorySlotUi"; - public void Setup(ItemSlotUi ui, ItemViewModel model) + public Task Setup(ItemSlotUi ui, ItemViewModel model) { if (InventoryManager.Instance.ContainInventoryItem(model.Id)) { @@ -15,7 +15,8 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) ui.ShowCountText(); ui.HideMark(); ui.SetButtonInteractable(true); - return; + + return Task.CompletedTask; } // TODO : 임시 초기화 값 @@ -36,6 +37,8 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) ui.HideCountText(); ui.HideMark(); ui.SetButtonInteractable(false); + + return Task.CompletedTask; } public async Task GetAnimatorController() diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventoryView.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventoryView.cs index 2e7a0090c..fb715f15e 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventoryView.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/InventoryUi/InventoryView.cs @@ -18,6 +18,8 @@ public class InventoryView : MonoBehaviour, IEventHandler private InventorySortType _currentSortType = InventorySortType.None; private const string ItemSlotUiName = "ItemSlotUi_"; + + public GameObject GetInitialSelected() => _firstSlot; private void OnEnable() { @@ -33,8 +35,6 @@ private void OnDisable() EventBus.Unregister(this); } - public GameObject GetInitialSelected() => _firstSlot; - public async Task Initialize() { _restaurantManagementSo = @@ -92,7 +92,7 @@ private IEnumerable SortSlots(IEnumerable slots) public void UpdateCategoryView(InventoryCategoryType category) { _currenInventoryCategoryType = category; - _firstSlot = null; + GameObject firstValidSlot = null; var filteredSlots = _slotLookup.Values; var sortedSlots = SortSlots(filteredSlots); @@ -114,12 +114,14 @@ public void UpdateCategoryView(InventoryCategoryType category) { slot.transform.SetSiblingIndex(siblingIndex++); - if (_firstSlot == null) + if (firstValidSlot == null) { - _firstSlot = slot.gameObject; + firstValidSlot = slot.gameObject; } } } + + _firstSlot = firstValidSlot; } private bool MatchesCategory(ItemViewModel model, InventoryCategoryType category) diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs index ba3b99566..ac0ed5bf0 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs @@ -6,7 +6,7 @@ namespace DDD public interface IItemSlotUiStrategy { string AnimatorControllerKey { get; } - void Setup(ItemSlotUi ui, ItemViewModel model); + Task Setup(ItemSlotUi ui, ItemViewModel model); Task GetAnimatorController(); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemSlotUi.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemSlotUi.cs index cb28a31fd..07584f8c3 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemSlotUi.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemSlotUi.cs @@ -26,7 +26,7 @@ public async Task Initialize(ItemViewModel model, IItemSlotUiStrategy strategy) var controller = await strategy.GetAnimatorController(); _animator.runtimeAnimatorController = controller; - Strategy.Setup(this, model); + _ = Strategy.Setup(this, model); } public void SetIcon(Sprite sprite) => _icon.sprite = sprite; diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/RestaurantManagementUi.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/RestaurantManagementUi.cs index a57817096..bf850249a 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/RestaurantManagementUi.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/RestaurantManagementUi.cs @@ -172,16 +172,7 @@ private void OnCategoryTabSelected(InventoryCategoryType category) public void Invoke(TodayMenuRemovedEvent evt) { - InventoryCategoryType newInventoryCategoryType = evt.RecipeType switch - { - RecipeType.FoodRecipe => InventoryCategoryType.Food, - RecipeType.DrinkRecipe => InventoryCategoryType.Drink, - _ => InventoryCategoryType.None - }; - - if (newInventoryCategoryType == InventoryCategoryType.None) return; - - _menuCategoryTabs.SelectTab(newInventoryCategoryType); + _menuCategoryTabs.SelectTab(evt.InventoryCategoryType); } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs index 7e976f5e7..ce2b6e936 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs @@ -8,7 +8,7 @@ public void OnAdded(ItemSlotUi itemSlotUi, RestaurantManagementSo restaurantMana if (inventorySlotUiStrategy.CanCrafting(itemSlotUi)) { - restaurantManagementSo.TryAddTodayMenu(itemSlotUi); + restaurantManagementSo.TryAddTodayMenu(itemSlotUi.Model); } else { @@ -25,7 +25,7 @@ public void OnRemoved(ItemSlotUi itemSlotUi, RestaurantManagementSo restaurantMa { if (itemSlotUi.Strategy is InventorySlotUiStrategy) return; - restaurantManagementSo.TryRemoveTodayMenu(itemSlotUi); + restaurantManagementSo.TryRemoveTodayMenu(itemSlotUi.Model); } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs index b95fb9b9e..ad1d5ee36 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs @@ -6,6 +6,7 @@ namespace DDD public class TodayMenuSlotUiStrategy : IItemSlotUiStrategy { private readonly RecipeType _recipeType; + private RestaurantManagementSo _restaurantManagementSo; public string AnimatorControllerKey => "TodayMenuSlotUi"; @@ -14,8 +15,10 @@ public TodayMenuSlotUiStrategy(RecipeType recipeType) _recipeType = recipeType; } - public void Setup(ItemSlotUi ui, ItemViewModel model) + public async Task Setup(ItemSlotUi ui, ItemViewModel model) { + _restaurantManagementSo = await AssetManager.LoadAsset(DataConstants.RestaurantManagementSo); + if (model == null) { string emptySpriteKey = null; @@ -32,12 +35,22 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) ui.HideCountText(); ui.HideMark(); ui.SetButtonInteractable(false); + return; } + string markSpriteKey = null; + if (_restaurantManagementSo.IsCookwareMatched(ui.Model.Id)) + { + markSpriteKey = SpriteConstants.CheckYesSpriteKey; + } + else + { + markSpriteKey = SpriteConstants.CheckNoSpriteKey; + } ui.SetIcon(model.ItemSprite); ui.HideCountText(); - ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭 + ui.ShowMark(DataManager.Instance.GetSprite(markSpriteKey)); ui.SetButtonInteractable(true); } diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs index 6307ef45a..3c912097d 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs @@ -8,7 +8,7 @@ public void OnAdded(ItemSlotUi itemSlotUi, RestaurantManagementSo restaurantMana if (inventorySlotUiStrategy.CanCrafting(itemSlotUi)) { - restaurantManagementSo.TryAddTodayCookware(itemSlotUi); + restaurantManagementSo.TryAddTodayCookware(itemSlotUi.Model); } else { @@ -25,7 +25,7 @@ public void OnRemoved(ItemSlotUi itemSlotUi, RestaurantManagementSo restaurantMa { if (itemSlotUi.Strategy is InventorySlotUiStrategy) return; - restaurantManagementSo.TryRemoveTodayCookware(itemSlotUi); + restaurantManagementSo.TryRemoveTodayCookware(itemSlotUi.Model); } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs index 445f90a50..08487cb1f 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs @@ -9,7 +9,7 @@ public class TodayCookwareSlotUiStrategy : IItemSlotUiStrategy public string AnimatorControllerKey => "TodayMenuSlotUi"; - public void Setup(ItemSlotUi ui, ItemViewModel model) + public Task Setup(ItemSlotUi ui, ItemViewModel model) { if (model == null) { @@ -17,13 +17,16 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) ui.HideCountText(); ui.HideMark(); ui.SetButtonInteractable(false); - return; + + return Task.CompletedTask; } ui.SetIcon(model.ItemSprite); ui.HideCountText(); ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭 ui.SetButtonInteractable(true); + + return Task.CompletedTask; } public async Task GetAnimatorController() diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs index 2de616ab6..55c9a59e8 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs @@ -101,7 +101,7 @@ private void UpdateView() } int cookwareIndex = 0; - foreach (var cookwareKey in _restaurantManagementSo.TodayCookwareIds) + foreach (var cookwareKey in _restaurantManagementSo.CookwareToRecipeIds.Keys) { if (cookwareIndex >= _cookwareSlots.Count) break; diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs index 7b40bf9ad..6296f6deb 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs @@ -9,7 +9,7 @@ public class TodayWorkerSlotUiStrategy : IItemSlotUiStrategy public string AnimatorControllerKey => "TodayMenuSlotUi"; - public void Setup(ItemSlotUi ui, ItemViewModel model) + public Task Setup(ItemSlotUi ui, ItemViewModel model) { if (model == null) { @@ -17,13 +17,16 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) ui.HideCountText(); ui.HideMark(); ui.SetButtonInteractable(false); - return; + + return Task.CompletedTask; } ui.SetIcon(model.ItemSprite); ui.HideCountText(); ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭 ui.SetButtonInteractable(true); + + return Task.CompletedTask; } public async Task GetAnimatorController() From 749d058cbd32fdcabe3c2297802d9ccb50b4bdf6 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 17:52:53 +0900 Subject: [PATCH 15/15] =?UTF-8?q?=EC=97=90=EC=85=8B=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Characters/Npcs/Customers/Customer.asset | 32 +++++++++++++++++++ .../Npcs/Customers/Customer.asset.meta | 8 +++++ .../Environments/Props/Prop_Open.prefab | 2 +- .../Props/Prop_Refrigerator.prefab | 25 ++++++++++++++- .../_Addressables/Prefabs/CustomerNpc.prefab | 18 ++++++++++- .../_ScriptAssets/Prefabs/UiManager.prefab | 2 +- 6 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset create mode 100644 Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset.meta diff --git a/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset b/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset new file mode 100644 index 000000000..dc12e9ef2 --- /dev/null +++ b/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset @@ -0,0 +1,32 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b23f08d2ae4cba14087c1ed36193d82b, type: 3} + m_Name: Customer + m_EditorClassIdentifier: + mBehaviorSource: + behaviorName: Behavior + behaviorDescription: + mTaskData: + types: [] + parentIndex: + startIndex: + variableStartIndex: + JSONSerialization: '{}' + fieldSerializationData: + typeName: [] + fieldNameHash: + startIndex: + dataPosition: + unityObjects: [] + byteData: + byteDataArray: + Version: 1.7.12 diff --git a/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset.meta b/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset.meta new file mode 100644 index 000000000..dede6c150 --- /dev/null +++ b/Assets/_DDD/Restaurant/Characters/Npcs/Customers/Customer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5b1a44992dce884984324332f431454 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab b/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab index 8d79b7dfb..55db45f7b 100644 --- a/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab +++ b/Assets/_DDD/Restaurant/Environments/Props/Prop_Open.prefab @@ -81,6 +81,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3} m_Name: m_EditorClassIdentifier: - _interactionType: 1 + _interactionType: 2 _holdTime: 1.3 _interactionMessageKey: Test diff --git a/Assets/_DDD/Restaurant/Environments/Props/Prop_Refrigerator.prefab b/Assets/_DDD/Restaurant/Environments/Props/Prop_Refrigerator.prefab index d34609747..3b419a25a 100644 --- a/Assets/_DDD/Restaurant/Environments/Props/Prop_Refrigerator.prefab +++ b/Assets/_DDD/Restaurant/Environments/Props/Prop_Refrigerator.prefab @@ -346,10 +346,33 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} insertIndex: -1 addedObject: {fileID: 7159781468411195695} - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + insertIndex: -1 + addedObject: {fileID: 5123936106469897444} m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} --- !u!4 &6689525833630355058 stripped Transform: m_CorrespondingSourceObject: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} m_PrefabInstance: {fileID: 4777358697124966162} m_PrefabAsset: {fileID: 0} +--- !u!1 &9211739394093953175 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3} + m_PrefabInstance: {fileID: 4777358697124966162} + m_PrefabAsset: {fileID: 0} +--- !u!114 &5123936106469897444 +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: 201f9e6d7ca7404baa9945950292a392, type: 3} + m_Name: + m_EditorClassIdentifier: + _interactionType: 1 + _holdTime: 1 + _interactionMessageKey: Test diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab index 7b33689ef..fc4907885 100644 --- a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab @@ -48,9 +48,25 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6826437533270866908, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: externalBehavior + value: + objectReference: {fileID: 11400000, guid: b5b1a44992dce884984324332f431454, type: 2} + - target: {fileID: 6826437533270866908, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: mBehaviorSource.behaviorName + value: Customer + objectReference: {fileID: 0} + - target: {fileID: 6826437533270866908, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: mBehaviorSource.mTaskData.Version + value: 1.7.12 + objectReference: {fileID: 0} + - target: {fileID: 6826437533270866908, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} + propertyPath: mBehaviorSource.mTaskData.JSONSerialization + value: '{}' + objectReference: {fileID: 0} - target: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} propertyPath: m_Name - value: RestaurantNpc + value: CustomerNpc objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/_DDD/_ScriptAssets/Prefabs/UiManager.prefab b/Assets/_DDD/_ScriptAssets/Prefabs/UiManager.prefab index de6b168dd..f87a2251a 100644 --- a/Assets/_DDD/_ScriptAssets/Prefabs/UiManager.prefab +++ b/Assets/_DDD/_ScriptAssets/Prefabs/UiManager.prefab @@ -922,7 +922,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 0 m_WrapAround: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0}