Blackboard Customer data Id만 받도록 수정

This commit is contained in:
김산 2025-08-28 12:55:21 +09:00
parent d1f4980da2
commit 60d0c80ad3
7 changed files with 40 additions and 24 deletions

Binary file not shown.

View File

@ -14,32 +14,36 @@ public class WaitForPlayerInteraction : Action
public override void OnStart() public override void OnStart()
{ {
GameObject interactionTarget = null; GameObject interactionTarget = null;
if(!gameObject.TryGetComponent<IAISharedBlackboard>(out var sharedBlackboard)) return; if (!gameObject.TryGetComponent<IAISharedBlackboard>(out var sharedBlackboard)) return;
interactionTarget = sharedBlackboard.GetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); interactionTarget =
sharedBlackboard.GetBlackboardGameObject(
if (interactionTarget == null) nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget));
{
Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); if (interactionTarget == null)
return; {
} Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}");
return;
if (!interactionTarget.TryGetComponent<RestaurantInteractionComponent>(out var interactionComponent)) }
Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}");
if (!interactionTarget.TryGetComponent<RestaurantInteractionComponent>(out var interactionComponent))
Debug.LogError(
$"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}");
if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner)
{ {
Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}"); Debug.LogError(
$"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}");
return; return;
} }
if (!subsystemOwner.TryGetSubsystemObject(out _interactionSubsystem)) if (!subsystemOwner.TryGetSubsystemObject(out _interactionSubsystem))
{ {
Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}"); Debug.LogError(
$"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}");
return; return;
} }
_interactionSubsystem.SetInteractionSubsystemType(_targetOrderType);
_isGetInteractionSubsystem = true; _isGetInteractionSubsystem = true;
} }
@ -51,7 +55,7 @@ public override TaskStatus OnUpdate()
if (result == TaskStatus.Success) Debug.Log($"[{GetType().Name}] Success"); if (result == TaskStatus.Success) Debug.Log($"[{GetType().Name}] Success");
return result; return result;
} }
private TaskStatus CheckToSubsystemStatus() private TaskStatus CheckToSubsystemStatus()
{ {
return _interactionSubsystem.GetInteractionSubsystemType() == _targetOrderType return _interactionSubsystem.GetInteractionSubsystemType() == _targetOrderType

View File

@ -48,7 +48,7 @@ private async Task InitializeAiInternal(CustomerData inCustomerData)
_behaviorTree.Subgraph = subtree; _behaviorTree.Subgraph = subtree;
_blackboardComponent.InitializeWithBehaviorTree(_behaviorTree); _blackboardComponent.InitializeWithBehaviorTree(_behaviorTree);
_blackboardComponent.SetCustomerData(inCustomerData); _blackboardComponent.SetCustomerData(inCustomerData.Id);
// TODO : 1. Subtree - Action, Condition // TODO : 1. Subtree - Action, Condition
// TODO : 2. Blackboard // TODO : 2. Blackboard
_behaviorTree.StartBehavior(); _behaviorTree.StartBehavior();

View File

@ -17,10 +17,10 @@ public void InitializeWithBehaviorTree(BehaviorTree inBehaviorTree)
} }
} }
public void SetCustomerData(CustomerData inCustomerData) public void SetCustomerData(string inCustomerDataId)
{ {
if (!_behaviorTree) return; if (!_behaviorTree) return;
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerDataId), inCustomerDataId);
} }
public void SetBlackboardGameObject(string key, GameObject inGameObject) public void SetBlackboardGameObject(string key, GameObject inGameObject)

View File

@ -5,12 +5,12 @@ namespace DDD
public enum RestaurantCustomerBlackboardKey public enum RestaurantCustomerBlackboardKey
{ {
SelfGameObject, SelfGameObject,
CustomerData, CustomerDataId,
CurrentInteractionTarget, CurrentInteractionTarget,
} }
public interface ICustomerBlackboard public interface ICustomerBlackboard
{ {
void SetCustomerData(CustomerData inCustomerData); void SetCustomerData(string inCustomerDataId);
} }
} }

View File

@ -0,0 +1,9 @@
using UnityEngine;
namespace DDD.Restaurant
{
public class PropUiDisplayComponent : MonoBehaviour
{
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 37e749c7ec5440d587f83c715f29ca8f
timeCreated: 1756353198