From d2f33de6abebf94f0bab4a4ddcddf1e4a4dbf8a3 Mon Sep 17 00:00:00 2001 From: Jeonghyeon Ha Date: Thu, 28 Aug 2025 10:49:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EC=8A=A4=ED=84=B0=EB=A8=B8=20AI=20?= =?UTF-8?q?=EB=B8=94=EB=9E=99=EB=B3=B4=EB=93=9C=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AI/Customer/Subtree/CustomerDefault.asset | 4 ++-- .../AI/Customer/CustomerAiComponent.cs | 2 +- .../Customer/CustomerBlackboardComponent.cs | 23 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset index db1314a20..193d9ef96 100644 --- a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset +++ b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af9dba1f3a650104808ecdbc956ad4af8327efcf0fe782348b231eb103f7469b -size 66226 +oid sha256:27a3a40bb3be1c167778bdc35a0ec6db10f288f1dde2c666105b98ffad079bdc +size 67663 diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs index 89593be6d..fa61ee462 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs @@ -47,7 +47,7 @@ private async Task InitializeAiInternal(CustomerData inCustomerData) } _behaviorTree.Subgraph = subtree; - _blackboardComponent.InitializeWithBehaviorTree(subtree); + _blackboardComponent.InitializeWithBehaviorTree(_behaviorTree); _blackboardComponent.SetCustomerData(inCustomerData); // TODO : 1. Subtree - Action, Condition // TODO : 2. Blackboard diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs index 8e594e7be..f56cd6b2b 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs @@ -5,33 +5,34 @@ namespace DDD { 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; - if (_subtree != null) + _behaviorTree = inBehaviorTree; + if (_behaviorTree) { - _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject); + _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject); } } public void SetCustomerData(CustomerData inCustomerData) { - if (_subtree == null) return; - _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); + if (!_behaviorTree) return; + _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); } public void SetBlackboardGameObject(string key, GameObject inGameObject) { - if (_subtree == null) return; - _subtree.SetVariableValue(key, inGameObject); + if (_behaviorTree == null) return; + _behaviorTree.SetVariableValue(key, inGameObject); } public GameObject GetBlackboardGameObject(string key) { - if (_subtree == null) return null; - return _subtree.GetVariable(key)?.Value; + if (_behaviorTree == null) return null; + return _behaviorTree.GetVariable(key)?.Value; } } } \ No newline at end of file