using Opsive.BehaviorDesigner.Runtime; using UnityEngine; namespace DDD { public class RestaurantCustomerBlackboardComponent : MonoBehaviour, IRestaurantCustomerBlackboard, IAISharedBlackboard { private Subtree _subtree; private GameObject _currentInteractionTarget; public void InitializeWithBehaviorTree(Subtree subtree) { _subtree = subtree; if (_subtree != null) { _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject); } } public void SetCustomerData(CustomerData inCustomerData) { if (_subtree == null) return; _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); } public void SetCurrentInteractionTarget(GameObject targetGameObject) { _currentInteractionTarget = targetGameObject; if (_subtree == null) return; _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), targetGameObject); } public GameObject GetCurrentInteractionTarget() { // 캐시 우선 반환. 필요 시 Subtree에서 직접 조회하도록 확장 가능. return _currentInteractionTarget; } } }