Exemple #1
0
 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);
 }
Exemple #2
0
        public ObjectMovementSpeedSystem(CoreInteractiveObject associatedInteractiveObject, TransformMoveManagerComponentV3 aiTransformMoveManagerComponentV3,
                                         IObjectSpeedAttenuationValueSystem ObjectSpeedAttenuationValueSystem, ObjectSpeedCalculationType InitialObjectSpeedCalculationType)
        {
            AssociatedInteractiveObject            = associatedInteractiveObject;
            AITransformMoveManagerComponentV3      = aiTransformMoveManagerComponentV3;
            this.ObjectSpeedCalculationType        = InitialObjectSpeedCalculationType;
            this.ObjectSpeedAttenuationValueSystem = ObjectSpeedAttenuationValueSystem;

            this.ObjectMovementSpeedSystemState = new ObjectMovementSpeedSystemState()
            {
                LastFrameWorldPosition = this.AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.transform.position,
            };
        }
Exemple #3
0
        public static float CalculateEffectiveSpeed_Unscaled_Attenuated(ObjectSpeedCalculationType ObjectSpeedCalculationType,
                                                                        CoreInteractiveObject CoreInteractiveObject,
                                                                        Vector3 LastFramePosition,
                                                                        TransformMoveManagerComponentV3 TransformMoveManagerComponentV3,
                                                                        float d)
        {
            var SpeedMagnitude = 0f;

            if (ObjectSpeedCalculationType == ObjectSpeedCalculationType.AGENT)
            {
                var agent = CoreInteractiveObject.InteractiveGameObject.Agent;
                if (agent != null && agent.hasPath)
                {
                    SpeedMagnitude  = Vector3.Distance(agent.transform.position, LastFramePosition) / d;
                    SpeedMagnitude /= TransformMoveManagerComponentV3.SpeedMultiplicationFactor;
                }
            }

            return(SpeedMagnitude);
        }
Exemple #4
0
 public AIRotationFacingMoveManager(NavMeshAgent objectAgent, TransformMoveManagerComponentV3 aiTransformMoveManagerComponentV3)
 {
     this.objectAgent = objectAgent;
     AITransformMoveManagerComponentV3 = aiTransformMoveManagerComponentV3;
 }
Exemple #5
0
 public AIRotationMoveManager(NavMeshAgent objectAgent, TransformMoveManagerComponentV3 AITransformMoveManagerComponentV3, AIDestinationManager AIDestinationManagerRef)
 {
     this.objectAgent = objectAgent;
     this.AITransformMoveManagerComponentV3 = AITransformMoveManagerComponentV3;
     this.AIDestinationManagerRef           = AIDestinationManagerRef;
 }
Exemple #6
0
 public PlayerAgentMoveManager(PlayerInteractiveObject playerAimingInteractiveObject, TransformMoveManagerComponentV3 TransformMoveManagerComponentV3,
                               OnAIInteractiveObjectDestinationReachedDelegate OnDestinationReachedCallback = null)
 {
     this.PlayerInteractiveObject   = playerAimingInteractiveObject;
     this.AIMoveToDestinationSystem = new AIMoveToDestinationSystem(playerAimingInteractiveObject, TransformMoveManagerComponentV3, OnDestinationReachedCallback);
     this.CurrentConstraint         = new NoConstraint();
 }
Exemple #7
0
 public AIPositionMoveManager(NavMeshAgent objectAgent, Func <Quaternion> CurrentLookingTargetRotationFromAIRotationMoveManager, TransformMoveManagerComponentV3 AITransformMoveManagerComponentV3)
 {
     this.objectAgent = objectAgent;
     this.CurrentLookingTargetRotationFromAIRotationMoveManager = CurrentLookingTargetRotationFromAIRotationMoveManager;
     this.AITransformMoveManagerComponentV3 = AITransformMoveManagerComponentV3;
 }