diff --git a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset index b4c023f9c..94df842de 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:03d01d4c1d7746e711e9ef21cafbfa8e0ffd13f6f6ad4fbacea3f7464426ba16 -size 67915 +oid sha256:11145b67edd52b3f90fcfa0bfa2cde8d4547c8a8a6edc28c2f9922a5e7211ebb +size 68048 diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs index 46579e1ce..30feb0826 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs @@ -14,32 +14,36 @@ public class WaitForPlayerInteraction : Action public override void OnStart() { - GameObject interactionTarget = null; - if(!gameObject.TryGetComponent(out var sharedBlackboard)) return; - interactionTarget = sharedBlackboard.GetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); - - if (interactionTarget == null) - { - Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); - return; - } - - if (!interactionTarget.TryGetComponent(out var interactionComponent)) - Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); + GameObject interactionTarget = null; + if (!gameObject.TryGetComponent(out var sharedBlackboard)) return; + interactionTarget = + sharedBlackboard.GetBlackboardGameObject( + nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + + if (interactionTarget == null) + { + Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); + return; + } + + if (!interactionTarget.TryGetComponent(out var interactionComponent)) + Debug.LogError( + $"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) { - Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}"); + Debug.LogError( + $"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}"); return; } if (!subsystemOwner.TryGetSubsystemObject(out _interactionSubsystem)) { - Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}"); + Debug.LogError( + $"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}"); return; } - - _interactionSubsystem.SetInteractionSubsystemType(_targetOrderType); + _isGetInteractionSubsystem = true; } @@ -51,7 +55,7 @@ public override TaskStatus OnUpdate() if (result == TaskStatus.Success) Debug.Log($"[{GetType().Name}] Success"); return result; } - + private TaskStatus CheckToSubsystemStatus() { return _interactionSubsystem.GetInteractionSubsystemType() == _targetOrderType diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs index fa61ee462..a0ba7d4ea 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs @@ -48,7 +48,7 @@ private async Task InitializeAiInternal(CustomerData inCustomerData) _behaviorTree.Subgraph = subtree; _blackboardComponent.InitializeWithBehaviorTree(_behaviorTree); - _blackboardComponent.SetCustomerData(inCustomerData); + _blackboardComponent.SetCustomerData(inCustomerData.Id); // TODO : 1. Subtree - Action, Condition // TODO : 2. Blackboard _behaviorTree.StartBehavior(); diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs index f56cd6b2b..41aee0f18 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs @@ -17,10 +17,10 @@ public void InitializeWithBehaviorTree(BehaviorTree inBehaviorTree) } } - public void SetCustomerData(CustomerData inCustomerData) + public void SetCustomerData(string inCustomerDataId) { if (!_behaviorTree) return; - _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); + _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerDataId), inCustomerDataId); } public void SetBlackboardGameObject(string key, GameObject inGameObject) diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs index 31c03ad24..8754ec832 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs @@ -5,12 +5,12 @@ namespace DDD public enum RestaurantCustomerBlackboardKey { SelfGameObject, - CustomerData, + CustomerDataId, CurrentInteractionTarget, } public interface ICustomerBlackboard { - void SetCustomerData(CustomerData inCustomerData); + void SetCustomerData(string inCustomerDataId); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs new file mode 100644 index 000000000..817d2635c --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace DDD.Restaurant +{ + public class PropUiDisplayComponent : MonoBehaviour + { + + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta new file mode 100644 index 000000000..2b5b6d8ec --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 37e749c7ec5440d587f83c715f29ca8f +timeCreated: 1756353198 \ No newline at end of file