CustomerDefault.asset 및 OrderSubtree.asset 행동 트리 수정: 불필요한 노드 제거 및 값 변경.

This commit is contained in:
김산 2025-09-02 12:42:55 +09:00
parent f57e3851e1
commit 5002d74c9b
10 changed files with 20 additions and 14 deletions

Binary file not shown.

Binary file not shown.

View File

@ -18,12 +18,14 @@ public interface IEmotionVisual
{
bool HasEmotionAvailable(EmotionType emotionType);
void ShowEmotion(EmotionType emotionType);
float GetEmotionDuration();
void EndEmotion();
}
//이를 파생해서 기본값을 주거나, 바로 사용하면 될 듯
[SerializeField] protected T _emotionBlackboardKey;
private IEmotionVisual _emotionVisual;
private float _emotionDuration;
public override void OnStart()
{
@ -44,10 +46,12 @@ public override void OnStart()
}
_emotionVisual.ShowEmotion(currentEmotion);
_emotionDuration = Time.time + _emotionVisual.GetEmotionDuration();
}
public override TaskStatus OnUpdate()
{
if (Time.time < _emotionDuration) return TaskStatus.Running;
return TaskStatus.Success;
}

View File

@ -20,7 +20,7 @@ public override TaskStatus OnUpdate()
RestaurantOrderInterrupt evt = new()
{
Table = currentTarget,
InteractableObject = currentTarget,
OrderObject = orderObject.GetOrderObjectState(),
TransitionType = _targetInterruptType
};

View File

@ -14,7 +14,8 @@ public enum RestaurantCustomerBlackboardKey
SatisfactionLevel,
CumulativeOrderCount,
MaxPatienceTime,
RemainingPatienceTime
RemainingPatienceTime,
Reward
}
public interface ICustomerBlackboard

View File

@ -19,7 +19,7 @@ public void Initialize()
var pointProviders = environmentState.GetPointProviderByType(PointType.Entry);
foreach (var pointProvider in pointProviders)
{
if (!pointProvider.IsSupportsType(PointType.Entry)) continue;
if (!pointProvider.CanProvidePoint(PointType.Entry)) continue;
_spawnPoint = pointProvider.GetPosition();
break;
}

View File

@ -8,11 +8,12 @@ public enum PointType
{
Entry,
Exit,
WaitingArea,
}
public interface IEnvironmentPointProvider
{
bool IsSupportsType(PointType pointType);
bool CanProvidePoint(PointType pointType);
Vector3 GetPosition();
GameObject GetGameObject();

View File

@ -28,7 +28,7 @@ public class RestaurantOrderObjectState
public class RestaurantOrderInterrupt : IEvent
{
public GameObject Table;
public GameObject InteractableObject;
public RestaurantOrderObjectState OrderObject;
public RestaurantOrderType TransitionType;
}
@ -129,7 +129,7 @@ public bool CanTransitionToNextPhase()
public void HandleEvent(RestaurantOrderInterrupt evt)
{
if (evt.Table != gameObject) return;
if (evt.InteractableObject != gameObject) return;
Debug.Log($"Order Interrupt : {evt.TransitionType}, Current State : {GetInteractionSubsystemType()}");
SetInteractionSubsystemType(evt.TransitionType);
}

View File

@ -4,7 +4,7 @@ namespace DDD.Restaurant
{
public class EnvironmentPointMarker : MonoBehaviour, IEnvironmentPointProvider
{
[SerializeField] PointType _pointType;
[SerializeField] private PointType _pointType;
private void Start()
{
@ -18,7 +18,7 @@ private void OnDisable()
environmentState?.UnRegisterPointProvider(this);
}
public bool IsSupportsType(PointType pointType)
public bool CanProvidePoint(PointType pointType)
{
return _pointType == pointType;
}

View File

@ -83,7 +83,7 @@ public List<IEnvironmentPointProvider> GetPointProviderByType(PointType pointTyp
_registeredPointProviders.RemoveAll(item => item == null || (item as UnityEngine.Object) == null);
foreach (var provider in _registeredPointProviders)
{
if (!provider.IsSupportsType(pointType)) continue;
if (!provider.CanProvidePoint(pointType)) continue;
result.Add(provider);
}
return result;