Merge branch 'feature/customer_behavior' into feature/customer_moveto/FixToBlackboard

# Conflicts:
#	Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs
This commit is contained in:
김산 2025-08-27 19:47:22 +09:00
commit 8851da71d3
5 changed files with 27 additions and 73 deletions

View File

@ -1210,9 +1210,6 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} - targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 3825874317044733320} addedObject: {fileID: 3825874317044733320}
- targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
insertIndex: -1
addedObject: {fileID: 1122074513716966771}
m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3}
--- !u!1 &4266090516809920735 stripped --- !u!1 &4266090516809920735 stripped
GameObject: GameObject:
@ -1255,23 +1252,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: af69e82818254bfa9cabb2dbf9430850, type: 3} m_Script: {fileID: 11500000, guid: af69e82818254bfa9cabb2dbf9430850, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: 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

View File

@ -188,7 +188,7 @@ public void Execute(ref DynamicBuffer<BranchComponent> branchComponents,
branchComponents[taskComponent.BranchIndex] = branchComponent; branchComponents[taskComponent.BranchIndex] = branchComponent;
continue; continue;
} }
else if (taskComponent.Status != TaskStatus.Running) if (taskComponent.Status != TaskStatus.Running)
{ {
continue; continue;
} }

View File

@ -21,6 +21,7 @@ public class StartRestaurantOrder : Action
public override void OnStart() public override void OnStart()
{ {
_isGetInteractor = gameObject.TryGetComponent(out _interactor); _isGetInteractor = gameObject.TryGetComponent(out _interactor);
if (!_isGetInteractor) if (!_isGetInteractor)
Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}"); Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}");
} }

View File

@ -17,55 +17,27 @@ public class WaitForPlayerInteraction : Action
public override void OnStart() public override void OnStart()
{ {
// 의자가 복합 상태를 가지게 될 경우 // 의자가 복합 상태를 가지게 될 경우
// GameObject interactionTarget = null; GameObject interactionTarget = null;
// var shared = gameObject.GetComponentInChildren<IAISharedBlackboard>(); var shared = gameObject.GetComponentInChildren<IAISharedBlackboard>();
// if (shared != null) if (shared != null)
// { {
// interactionTarget = shared.GetCurrentInteractionTarget(); interactionTarget = shared.GetCurrentInteractionTarget();
// } }
// else else
// { {
// // 하위 호환: 고객 전용 블랙보드 지원 // 하위 호환: 고객 전용 블랙보드 지원
// var customerBb = gameObject.GetComponentInParent<IRestaurantCustomerBlackboard>(); var customerBb = gameObject.GetComponentInParent<IRestaurantCustomerBlackboard>();
// interactionTarget = customerBb?.GetCurrentInteractionTarget(); interactionTarget = customerBb?.GetCurrentInteractionTarget();
// } }
//
// if (interactionTarget == null) if (interactionTarget == null)
// { {
// Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}");
// return; return;
// } }
//
// if (!interactionTarget.TryGetComponent<RestaurantInteractionComponent>(out var interactionComponent)) if (!interactionTarget.TryGetComponent<RestaurantInteractionComponent>(out var interactionComponent))
// Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}");
// if (interactionComponent is IInteractionSubsystemOwner subsystemOwner)
// {
// if (!subsystemOwner.TryGetSubsystemObject<RestaurantMealType>(out var subsystem))
// {
// Debug.LogError($"[{GetType().Name}] {nameof(_targetOrderType)}의 Subsystem을 찾을 수 없습니다: {gameObject.name}");
// _isGetInteractionSubsystem = false;
// return;
// }
//
// _isGetInteractionSubsystem = true;
// subsystem.SetInteractionSubsystemType(_targetOrderType);
//
// if (!gameObject.TryGetComponent<IInteractor>(out var interactor))
// {
// Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}");
// return;
// }
//
// interactor.CanInteractTo(interactionComponent);
//
// _interactionSubsystem = subsystem;
// }
if (!gameObject.TryGetComponent<RestaurantInteractionComponent>(out var interactionComponent))
{
Debug.LogError($"[{GetType().Name}]에서 interactionComponent를 찾을 수 없습니다: {gameObject.name}");
return;
}
if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner)
{ {

View File

@ -1,4 +1,5 @@
using System; using System;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
namespace DDD namespace DDD
@ -23,11 +24,13 @@ public RestaurantMealType GetInteractionSubsystemType()
public void SetInteractionSubsystemType(RestaurantMealType inValue) public void SetInteractionSubsystemType(RestaurantMealType inValue)
{ {
Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] SetInteractionSubsystemType {inValue.ToString()}");
_currentRestaurantMealType = inValue; _currentRestaurantMealType = inValue;
} }
public void InitializeSubsystem() public void InitializeSubsystem()
{ {
Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] InitializeSubsystem");
_currentRestaurantMealType = RestaurantMealType.None; _currentRestaurantMealType = RestaurantMealType.None;
} }
@ -38,6 +41,7 @@ public bool CanInteract()
public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null)
{ {
Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] OnInteracted");
var prev = _currentRestaurantMealType; var prev = _currentRestaurantMealType;
_currentRestaurantMealType = GetNextState(prev); _currentRestaurantMealType = GetNextState(prev);
return true; return true;