Blackboard Customer data Id만 받도록 수정
This commit is contained in:
parent
d1f4980da2
commit
60d0c80ad3
BIN
Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset
(Stored with Git LFS)
Binary file not shown.
@ -16,7 +16,9 @@ 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(
|
||||||
|
nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget));
|
||||||
|
|
||||||
if (interactionTarget == null)
|
if (interactionTarget == null)
|
||||||
{
|
{
|
||||||
@ -25,21 +27,23 @@ public override void OnStart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
@ -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)
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD.Restaurant
|
||||||
|
{
|
||||||
|
public class PropUiDisplayComponent : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 37e749c7ec5440d587f83c715f29ca8f
|
||||||
|
timeCreated: 1756353198
|
Loading…
Reference in New Issue
Block a user