Merge remote-tracking branch 'origin/feature/customer_moveto' into feature/customer_moveto/FixToBlackboard
This commit is contained in:
commit
60205d3c00
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.
@ -47,7 +47,7 @@ private async Task InitializeAiInternal(CustomerData inCustomerData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_behaviorTree.Subgraph = subtree;
|
_behaviorTree.Subgraph = subtree;
|
||||||
_blackboardComponent.InitializeWithBehaviorTree(subtree);
|
_blackboardComponent.InitializeWithBehaviorTree(_behaviorTree);
|
||||||
_blackboardComponent.SetCustomerData(inCustomerData);
|
_blackboardComponent.SetCustomerData(inCustomerData);
|
||||||
// TODO : 1. Subtree - Action, Condition
|
// TODO : 1. Subtree - Action, Condition
|
||||||
// TODO : 2. Blackboard
|
// TODO : 2. Blackboard
|
||||||
|
@ -5,33 +5,34 @@ namespace DDD
|
|||||||
{
|
{
|
||||||
public class CustomerBlackboardComponent : MonoBehaviour, ICustomerBlackboard, IAISharedBlackboard
|
public class CustomerBlackboardComponent : MonoBehaviour, ICustomerBlackboard, IAISharedBlackboard
|
||||||
{
|
{
|
||||||
private Subtree _subtree;
|
// private Subtree _behaviorTree;
|
||||||
|
private BehaviorTree _behaviorTree;
|
||||||
|
|
||||||
public void InitializeWithBehaviorTree(Subtree subtree)
|
public void InitializeWithBehaviorTree(BehaviorTree inBehaviorTree)
|
||||||
{
|
{
|
||||||
_subtree = subtree;
|
_behaviorTree = inBehaviorTree;
|
||||||
if (_subtree != null)
|
if (_behaviorTree)
|
||||||
{
|
{
|
||||||
_subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
|
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCustomerData(CustomerData inCustomerData)
|
public void SetCustomerData(CustomerData inCustomerData)
|
||||||
{
|
{
|
||||||
if (_subtree == null) return;
|
if (!_behaviorTree) return;
|
||||||
_subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData);
|
_behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetBlackboardGameObject(string key, GameObject inGameObject)
|
public void SetBlackboardGameObject(string key, GameObject inGameObject)
|
||||||
{
|
{
|
||||||
if (_subtree == null) return;
|
if (_behaviorTree == null) return;
|
||||||
_subtree.SetVariableValue(key, inGameObject);
|
_behaviorTree.SetVariableValue(key, inGameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameObject GetBlackboardGameObject(string key)
|
public GameObject GetBlackboardGameObject(string key)
|
||||||
{
|
{
|
||||||
if (_subtree == null) return null;
|
if (_behaviorTree == null) return null;
|
||||||
return _subtree.GetVariable<GameObject>(key)?.Value;
|
return _behaviorTree.GetVariable<GameObject>(key)?.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user