Merge remote-tracking branch 'origin/develop' into feature/customer_behavior
This commit is contained in:
commit
faaa2cbce6
@ -1,4 +1,4 @@
|
||||
namespace DDD
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public interface IMovementConstraint
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ public override TaskStatus OnUpdate()
|
||||
if (_registerOnBlackboard)
|
||||
{
|
||||
// 하위 호환: 고객 전용 블랙보드 지원
|
||||
var customerBlackboard = gameObject.GetComponent<IRestaurantCustomerBlackboard>();
|
||||
var customerBlackboard = gameObject.GetComponent<ICustomerBlackboard>();
|
||||
customerBlackboard?.SetCurrentInteractionTarget(outInteractable.gameObject);
|
||||
}
|
||||
|
@ -8,16 +8,16 @@
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(BehaviorTree))]
|
||||
[RequireComponent(typeof(RestaurantCustomerBlackboardComponent))]
|
||||
public class RestaurantCustomerAiComponent : MonoBehaviour, IRestaurantCustomerAi
|
||||
[RequireComponent(typeof(CustomerBlackboardComponent))]
|
||||
public class CustomerAiComponent : MonoBehaviour, ICustomerAi
|
||||
{
|
||||
protected BehaviorTree _behaviorTree;
|
||||
protected RestaurantCustomerBlackboardComponent _blackboardComponent;
|
||||
protected CustomerBlackboardComponent _blackboardComponent;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_behaviorTree = GetComponent<BehaviorTree>();
|
||||
_blackboardComponent = GetComponent<RestaurantCustomerBlackboardComponent>();
|
||||
_blackboardComponent = GetComponent<CustomerBlackboardComponent>();
|
||||
}
|
||||
|
||||
public async Task InitializeAi(CustomerData inCustomerData)
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantCustomerBlackboardComponent : MonoBehaviour, IRestaurantCustomerBlackboard, IAISharedBlackboard
|
||||
public class CustomerBlackboardComponent : MonoBehaviour, ICustomerBlackboard, IAISharedBlackboard
|
||||
{
|
||||
private Subtree _subtree;
|
||||
private GameObject _currentInteractionTarget;
|
@ -3,7 +3,7 @@
|
||||
namespace DDD
|
||||
{
|
||||
[RequireComponent(typeof(SpineController))]
|
||||
public class RestaurantCharacterAnimation : MonoBehaviour
|
||||
public class CharacterAnimation : MonoBehaviour
|
||||
{
|
||||
protected SpineController _spineController;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEventHandler<RestaurantInteractionEvent>
|
||||
public class CharacterInteraction : MonoBehaviour, IInteractor, IEventHandler<RestaurantInteractionEvent>
|
||||
{
|
||||
[EnumToggleButtons, SerializeField] protected InteractionType _availableInteractions;
|
||||
[SerializeField, ReadOnly] protected Collider[] _nearColliders = new Collider[10];
|
@ -2,18 +2,18 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantCharacterMovement : MonoBehaviour
|
||||
public class CharacterMovement : MonoBehaviour
|
||||
{
|
||||
private RestaurantCharacterMovementConstraint _constraint;
|
||||
private CharacterMovementConstraint _constraint;
|
||||
protected virtual void Awake()
|
||||
{
|
||||
_constraint = gameObject.AddComponent<RestaurantCharacterMovementConstraint>();
|
||||
_constraint = gameObject.AddComponent<CharacterMovementConstraint>();
|
||||
}
|
||||
|
||||
public virtual bool CanMove()
|
||||
{
|
||||
// Get all components implements IRestaurantMovementConstraint
|
||||
var constraints = GetComponents<IRestaurantMovementConstraint>();
|
||||
// Get all components implements IMovementConstraint
|
||||
var constraints = GetComponents<IMovementConstraint>();
|
||||
// TODO : Maybe need optimize GetComponents?
|
||||
foreach (var movementConstraint in constraints)
|
||||
{
|
@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
[RequireComponent(typeof(CharacterAnimation))]
|
||||
public class CharacterMovementConstraint : MonoBehaviour, IMovementConstraint
|
||||
{
|
||||
public bool IsBlockingMovement()
|
||||
{
|
||||
if (GetComponent<CharacterAnimation>().IsPlayingAnimation())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantCharacterVisual : MonoBehaviour
|
||||
public class CharacterVisual : MonoBehaviour
|
||||
{
|
||||
private ICurrentDirection _iCurrentDirection;
|
||||
|
@ -3,16 +3,16 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(RestaurantCharacterInteraction))]
|
||||
[RequireComponent(typeof(CharacterInteraction))]
|
||||
[RequireComponent(typeof(SpineController))]
|
||||
public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor
|
||||
{
|
||||
RestaurantCharacterInteraction _interactionComponent;
|
||||
CharacterInteraction _interactionComponent;
|
||||
protected SpineController _spineController;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
_interactionComponent = GetComponent<RestaurantCharacterInteraction>();
|
||||
_interactionComponent = GetComponent<CharacterInteraction>();
|
||||
_spineController = GetComponent<SpineController>();
|
||||
foreach (var typeToSolver in RestaurantInteractionEventSolvers.TypeToSolver)
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public interface IRestaurantCustomerAi
|
||||
public interface ICustomerAi
|
||||
{
|
||||
Task InitializeAi(CustomerData inCustomerData);
|
||||
}
|
@ -9,7 +9,7 @@ public enum RestaurantCustomerBlackboardKey
|
||||
CurrentInteractionTarget,
|
||||
}
|
||||
|
||||
public interface IRestaurantCustomerBlackboard
|
||||
public interface ICustomerBlackboard
|
||||
{
|
||||
void SetCustomerData(CustomerData inCustomerData);
|
||||
void SetCurrentInteractionTarget(GameObject targetGameObject);
|
@ -1,6 +1,6 @@
|
||||
namespace DDD
|
||||
{
|
||||
public interface IRestaurantMovementConstraint
|
||||
public interface IMovementConstraint
|
||||
{
|
||||
public bool IsBlockingMovement();
|
||||
}
|
@ -5,22 +5,22 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(RestaurantCustomerAiComponent))]
|
||||
public class CustomerCharacter : RestaurantNpcCharacter, ICustomerInitializer
|
||||
[RequireComponent(typeof(CustomerAiComponent))]
|
||||
public class CustomerCharacter : NpcCharacter, ICustomerInitializer
|
||||
{
|
||||
private CustomerData _customerData;
|
||||
protected IRestaurantCustomerAi restaurantCustomerAi;
|
||||
protected ICustomerAi _customerAi;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
restaurantCustomerAi = GetComponent<IRestaurantCustomerAi>();
|
||||
_customerAi = GetComponent<ICustomerAi>();
|
||||
}
|
||||
|
||||
public void Initialize(CustomerData customerData)
|
||||
{
|
||||
_customerData = customerData;
|
||||
restaurantCustomerAi.InitializeAi(_customerData);
|
||||
_customerAi.InitializeAi(_customerData);
|
||||
|
||||
// 스킨 설정
|
||||
_spineController.SetSkin(_customerData.SpineSkinKey);
|
@ -3,8 +3,8 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(RestaurantNpcMovement))]
|
||||
public class RestaurantNpcCharacter : RestaurantCharacter
|
||||
[RequireComponent(typeof(NpcMovement))]
|
||||
public class NpcCharacter : RestaurantCharacter
|
||||
{
|
||||
protected override void Awake()
|
||||
{
|
@ -4,7 +4,7 @@
|
||||
namespace DDD
|
||||
{
|
||||
[RequireComponent(typeof(AIPath))]
|
||||
public class RestaurantNpcMovement : RestaurantCharacterMovement, IAiMovement, ICurrentDirection
|
||||
public class NpcMovement : CharacterMovement, IAiMovement, ICurrentDirection
|
||||
{
|
||||
private IAstarAI _iAstarAi;
|
||||
private Vector3 _lastDirection = Vector3.forward;
|
@ -2,34 +2,34 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(RestaurantPlayerMovement))]
|
||||
public class RestaurantPlayerAnimation : RestaurantCharacterAnimation
|
||||
[RequireComponent(typeof(PlayerMovement))]
|
||||
public class PlayerAnimation : CharacterAnimation
|
||||
{
|
||||
private RestaurantPlayerMovement _restaurantPlayerMovement;
|
||||
private PlayerMovement _playerMovement;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
_restaurantPlayerMovement = GetComponent<RestaurantPlayerMovement>();
|
||||
_playerMovement = GetComponent<PlayerMovement>();
|
||||
}
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
_restaurantPlayerMovement.OnMoving += OnMove;
|
||||
_restaurantPlayerMovement.OnDashing += OnDash;
|
||||
_playerMovement.OnMoving += OnMove;
|
||||
_playerMovement.OnDashing += OnDash;
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
if (_restaurantPlayerMovement)
|
||||
if (_playerMovement)
|
||||
{
|
||||
_restaurantPlayerMovement.OnMoving -= OnMove;
|
||||
_restaurantPlayerMovement.OnDashing -= OnDash;
|
||||
_playerMovement.OnMoving -= OnMove;
|
||||
_playerMovement.OnDashing -= OnDash;
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(RestaurantPlayerMovement))]
|
||||
public class RestaurantPlayerCharacter : RestaurantCharacter
|
||||
[RequireComponent(typeof(PlayerMovement))]
|
||||
public class PlayerCharacter : RestaurantCharacter
|
||||
{
|
||||
protected override void Awake()
|
||||
{
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantPlayerInput : MonoBehaviour
|
||||
public class PlayerInput : MonoBehaviour
|
||||
{
|
||||
private RestaurantPlayerData _playerDataSo;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantPlayerInteraction : RestaurantCharacterInteraction
|
||||
public class PlayerInteraction : CharacterInteraction
|
||||
{
|
||||
private RestaurantPlayerData _restaurantPlayerDataSo;
|
||||
|
@ -9,7 +9,7 @@ namespace DDD.Restaurant
|
||||
{
|
||||
[RequireComponent(typeof(Rigidbody))]
|
||||
[RequireComponent(typeof(BoxCollider))]
|
||||
public class RestaurantPlayerMovement : RestaurantCharacterMovement, ICurrentDirection
|
||||
public class PlayerMovement : CharacterMovement, ICurrentDirection
|
||||
{
|
||||
#region Fields
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantEnvironmentController : FlowController
|
||||
public class EnvironmentController : FlowController
|
||||
{
|
||||
private RestaurantEnvironmentState _environmentState;
|
||||
public override Task InitializeController()
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantGlobalMessageController : FlowController
|
||||
public class GlobalMessageController : FlowController
|
||||
{
|
||||
private const string ReadyForRestaurantMessageKey = "ready_for_restaurant_message";
|
||||
private const string RunRestaurantMessageKey = "run_restaurnat_message";
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantManagementController : FlowController
|
||||
public class ManagementController : FlowController
|
||||
{
|
||||
public override Task InitializeController()
|
||||
{
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantPlayerController : FlowController
|
||||
public class PlayerController : FlowController
|
||||
{
|
||||
public override Task InitializeController()
|
||||
{
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantRunController : FlowController
|
||||
public class RunController : FlowController
|
||||
{
|
||||
private RestaurantCustomerState _restaurantCustomerStateSo;
|
||||
private RestaurantRunState _restaurantRunStateSo;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user