diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab index 80cdc789c..d16acedec 100644 --- a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab @@ -1210,9 +1210,6 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} insertIndex: -1 addedObject: {fileID: 3825874317044733320} - - targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} - insertIndex: -1 - addedObject: {fileID: 1122074513716966771} m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} --- !u!1 &4266090516809920735 stripped GameObject: @@ -1255,23 +1252,3 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: af69e82818254bfa9cabb2dbf9430850, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &1122074513716966771 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4266090516809920735} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3} - m_Name: - m_EditorClassIdentifier: - _interactionType: 4 - _executionParameters: - _holdTime: 0 - _displayParameters: - _messageKey: - _interactionAvailableFlows: 2 - _aiInteractionPoints: [] - autoInitialize: 1 diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs index ec725c587..15c13cd29 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs @@ -188,7 +188,7 @@ public void Execute(ref DynamicBuffer branchComponents, branchComponents[taskComponent.BranchIndex] = branchComponent; continue; } - else if (taskComponent.Status != TaskStatus.Running) + if (taskComponent.Status != TaskStatus.Running) { continue; } diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs index 98d9b39c6..b954d1bf7 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs @@ -21,6 +21,7 @@ public class StartRestaurantOrder : Action public override void OnStart() { _isGetInteractor = gameObject.TryGetComponent(out _interactor); + if (!_isGetInteractor) Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}"); } diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs index b8da8cbf0..8f2f3f801 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs @@ -17,55 +17,27 @@ public class WaitForPlayerInteraction : Action public override void OnStart() { // 의자가 복합 상태를 가지게 될 경우 - // GameObject interactionTarget = null; - // var shared = gameObject.GetComponentInChildren(); - // if (shared != null) - // { - // interactionTarget = shared.GetCurrentInteractionTarget(); - // } - // else - // { - // // 하위 호환: 고객 전용 블랙보드 지원 - // var customerBb = gameObject.GetComponentInParent(); - // interactionTarget = customerBb?.GetCurrentInteractionTarget(); - // } - // - // if (interactionTarget == null) - // { - // Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); - // return; - // } - // - // if (!interactionTarget.TryGetComponent(out var interactionComponent)) - // Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); - // if (interactionComponent is IInteractionSubsystemOwner subsystemOwner) - // { - // if (!subsystemOwner.TryGetSubsystemObject(out var subsystem)) - // { - // Debug.LogError($"[{GetType().Name}] {nameof(_targetOrderType)}의 Subsystem을 찾을 수 없습니다: {gameObject.name}"); - // _isGetInteractionSubsystem = false; - // return; - // } - // - // _isGetInteractionSubsystem = true; - // subsystem.SetInteractionSubsystemType(_targetOrderType); - // - // if (!gameObject.TryGetComponent(out var interactor)) - // { - // Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}"); - // return; - // } - // - // interactor.CanInteractTo(interactionComponent); - // - // _interactionSubsystem = subsystem; - // } - - if (!gameObject.TryGetComponent(out var interactionComponent)) - { - Debug.LogError($"[{GetType().Name}]에서 interactionComponent를 찾을 수 없습니다: {gameObject.name}"); - return; - } + GameObject interactionTarget = null; + var shared = gameObject.GetComponentInChildren(); + if (shared != null) + { + interactionTarget = shared.GetCurrentInteractionTarget(); + } + else + { + // 하위 호환: 고객 전용 블랙보드 지원 + var customerBb = gameObject.GetComponentInParent(); + interactionTarget = customerBb?.GetCurrentInteractionTarget(); + } + + if (interactionTarget == null) + { + Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); + return; + } + + if (!interactionTarget.TryGetComponent(out var interactionComponent)) + Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) { diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs index 25433d327..48b1b410d 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs @@ -1,4 +1,5 @@ using System; +using Unity.VisualScripting; using UnityEngine; namespace DDD @@ -23,11 +24,13 @@ public RestaurantMealType GetInteractionSubsystemType() public void SetInteractionSubsystemType(RestaurantMealType inValue) { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] SetInteractionSubsystemType {inValue.ToString()}"); _currentRestaurantMealType = inValue; } public void InitializeSubsystem() { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] InitializeSubsystem"); _currentRestaurantMealType = RestaurantMealType.None; } @@ -38,6 +41,7 @@ public bool CanInteract() public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] OnInteracted"); var prev = _currentRestaurantMealType; _currentRestaurantMealType = GetNextState(prev); return true;