public NavMeshPathStatus SetDestination(IAgentMovementCalculationStrategy IAgentMovementCalculationStrategy) { if (LastIAgentMovementCalculationStrategyType == null || LastIAgentMovementCalculationStrategyType != IAgentMovementCalculationStrategy.GetType()) { switch (IAgentMovementCalculationStrategy) { case ForwardAgentMovementCalculationStrategy ForwardAgentMovementCalculationStrategy: this.A_AIRotationMoveManager = new AIRotationMoveManager(this.objectAgent, this.AITransformMoveManagerComponentV3, this.AIDestinationManager); break; case LookingAtAgentMovementCalculationStrategy LookingAtAgentMovementCalculationStrategy: this.A_AIRotationMoveManager = new AIRotationFacingMoveManager(this.objectAgent, this.AITransformMoveManagerComponentV3); break; } } switch (IAgentMovementCalculationStrategy) { case LookingAtAgentMovementCalculationStrategy LookingAtAgentMovementCalculationStrategy: (this.A_AIRotationMoveManager as AIRotationFacingMoveManager).Init(LookingAtAgentMovementCalculationStrategy.TargetLook); break; } this.LastIAgentMovementCalculationStrategyType = IAgentMovementCalculationStrategy.GetType(); return(this.AIDestinationManager.SetDestination(IAgentMovementCalculationStrategy.GetAIDestination())); }
public AIMoveToDestinationSystem(CoreInteractiveObject CoreInteractiveObject, TransformMoveManagerComponentV3 AITransformMoveManagerComponentV3, OnAIInteractiveObjectDestinationReachedDelegate OnAIInteractiveObjectDestinationReached = null) { this.IsEnabled = true; this.objectAgent = CoreInteractiveObject.InteractiveGameObject.Agent; this.AITransformMoveManagerComponentV3 = AITransformMoveManagerComponentV3; this.aiPositionMoveManager = new AIPositionMoveManager(this.objectAgent, () => this.A_AIRotationMoveManager.CurrentLookingTargetRotation, AITransformMoveManagerComponentV3); this.AIDestinationManager = new AIDestinationManager(this.objectAgent, OnAIInteractiveObjectDestinationReached); this.A_AIRotationMoveManager = new AIRotationMoveManager(this.objectAgent, AITransformMoveManagerComponentV3, this.AIDestinationManager); }