diff --git a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset index 3e1550f51..7529b61c5 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:1c251100bc2c608cf33bccb1bded2c1618a1df83680615f821597aaaa63b5fb2 -size 67301 +oid sha256:8089b1a0f359704e721ce008d9816bc58743c7a00abdf7cc504619f18500877f +size 67585 diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs index 03480dd1a..8a8aff755 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs @@ -38,7 +38,7 @@ public override void OnStart() var blackboard = gameObject.GetComponent(); - _cachedTarget = blackboard.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + _cachedTarget = blackboard.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject)); } public override TaskStatus OnUpdate() diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToTargetPoint.cs similarity index 98% rename from Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToTargetPoint.cs index 90f804fed..26b4271b8 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToTargetPoint.cs @@ -8,7 +8,7 @@ namespace DDD.Restaurant /// /// IAiMovement를 이용해 인터랙션 타겟으로 이동하는 액션 /// - public class MoveToInteractionTarget : Action + public class MoveToTargetPoint : Action { [Header("Target Settings")] [Tooltip("InteractionPoints를 사용해 가장 가까운 지점으로 이동")] @@ -41,7 +41,7 @@ public override void OnStart() _isMoving = false; var blackboard = gameObject.GetComponent(); - _target = blackboard.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + _target = blackboard.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject)); } public override TaskStatus OnUpdate() diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToTargetPoint.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToTargetPoint.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs new file mode 100644 index 000000000..45405d752 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using Opsive.GraphDesigner.Runtime.Variables; +using UnityEngine; + +namespace DDD.Restaurant +{ + public class BlackboardSo : ScriptableObject where T : Enum + { + private Dictionary _variables = new(); + + public SharedVariable GetVariable(T key) + { + if (_variables.TryGetValue(key, out var variable)) + { + return variable as SharedVariable; + } + + return null; + } + + public void SetVariable(T key, T1 value) + { + var outVariable = GetVariable(key); + if (outVariable != null) + { + outVariable.Value = value; + } + else + { + SharedVariable sharedVariable = new SharedVariable() { Value = value }; + _variables.Add(key, sharedVariable); + } + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs.meta new file mode 100644 index 000000000..f2af04ccc --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/BlackboardSO.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 24029c24eac8499bbb9ca02126da8148 +timeCreated: 1756462002 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs index c471f6b78..ed1ac3a16 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs @@ -23,7 +23,7 @@ public override void OnStart() public override TaskStatus OnUpdate() { var blackboard = gameObject.GetComponent(); - var target = blackboard?.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + var target = blackboard?.GetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject)); IInteractable currentInteractable = target?.GetComponent(); if (_targetOrderType == RestaurantOrderType.Wait) { @@ -34,7 +34,7 @@ public override TaskStatus OnUpdate() return TaskStatus.Failure; } var customerBlackboard = gameObject.GetComponent(); - customerBlackboard?.SetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), currentInteractable.GetInteractableGameObject()); + customerBlackboard?.SetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject), currentInteractable.GetInteractableGameObject()); } // Check order type of the current interactable @@ -71,7 +71,7 @@ public override TaskStatus OnUpdate() if (_targetOrderType == RestaurantOrderType.Busy) { var customerBlackboard = gameObject.GetComponent(); - customerBlackboard?.SetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), null); + customerBlackboard?.SetBlackboardValue(nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject), null); } return TaskStatus.Success; 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 934bb7159..fd8338fbf 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs @@ -19,7 +19,7 @@ public override void OnStart() if (!gameObject.TryGetComponent(out var sharedBlackboard)) return; interactionTarget = sharedBlackboard.GetBlackboardValue( - nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + nameof(RestaurantCustomerBlackboardKey.CurrentTargetGameObject)); if (interactionTarget == null) { diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs index bacbb2f99..04cfef17a 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs @@ -6,9 +6,9 @@ public enum RestaurantCustomerBlackboardKey { SelfGameObject, CustomerDataId, - CurrentInteractionTarget, - CurrentMarkerTarget, - IsSatisfy + CurrentTargetGameObject, + SatisfactionLevel, + OrderCount, } public interface ICustomerBlackboard diff --git a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs index e860b3463..fe2408697 100644 --- a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using DDD.Restaurant; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { [Serializable] public class RestaurantPropLocation