Exemplo n.º 1
0
 public void OnInteractiveObjectCreated(CoreInteractiveObject CoreInteractiveObject)
 {
     if (OnAllInteractiveObjectCreatedEvent != null)
     {
         OnAllInteractiveObjectCreatedEvent.Invoke(CoreInteractiveObject);
     }
 }
Exemplo n.º 2
0
 private void OnInteractiveObjectdestroyed(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Remove(interactiveObject))
     {
         this.ClearReferencesOfRemovedInteractiveObject(interactiveObject);
     }
 }
Exemplo n.º 3
0
 public void OnInteractiveObjectDestroyed(CoreInteractiveObject CoreInteractiveObject)
 {
     if (OnInteractiveObjectDestroyedEvent != null)
     {
         OnInteractiveObjectDestroyedEvent.Invoke(CoreInteractiveObject);
     }
 }
Exemplo n.º 4
0
 public void RemoveInteractiveObject(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Remove(interactiveObject))
     {
         ClearReferencesOfRemovedInteractiveObject(interactiveObject);
     }
 }
Exemplo n.º 5
0
        public DisarmObjectSystem(CoreInteractiveObject AssociatedInteractiveObject, DisarmSystemDefinition DisarmObjectInitializationData,
                                  InteractiveObjectTagStruct PhysicsEventListenerGuard, Action <CoreInteractiveObject> OnAssociatedDisarmObjectTriggerEnter,
                                  Action <CoreInteractiveObject> OnAssociatedDisarmObjectTriggerExit)
        {
            DisarmSystemDefinition = DisarmObjectInitializationData;
            SphereRange            = new SphereRangeObjectV2(AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, new SphereRangeObjectInitialization
            {
                RangeTypeID = RangeTypeID.NOT_DISPLAYED,
                IsTakingIntoAccountObstacles = false,
                SphereRangeTypeDefinition    = new SphereRangeTypeDefinition
                {
                    Radius = DisarmObjectInitializationData.DisarmRange
                }
            }, AssociatedInteractiveObject, AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_DisarmTriggerRange");
            SphereRange.RegisterPhysicsEventListener(new RangeObjectV2PhysicsEventListener_Delegated(PhysicsEventListenerGuard, OnAssociatedDisarmObjectTriggerEnter, OnAssociatedDisarmObjectTriggerExit));

            ProgressBarGameObject = new GameObject("ProgressBar");
            ProgressBarGameObject.transform.parent = AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.transform;
            progressbar = ProgressBarGameObject.AddComponent <CircleFillBarType>();

            progressbar.Init(Camera.main);
            progressbar.transform.position = AssociatedInteractiveObject.InteractiveGameObject.GetTransform().WorldPosition + (Vector3.up * (AssociatedInteractiveObject.InteractiveGameObject.AverageModelBounds.Bounds.max.y));
            progressbar.gameObject.SetActive(false);

            elapsedTime = 0f;
        }
Exemplo n.º 6
0
 public void AddInteractiveObject(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Add(interactiveObject))
     {
         interactiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnInteractiveObjectdestroyed);
         this.OnInteractiveObjectJustAdded?.Invoke(interactiveObject);
     }
 }
Exemplo n.º 7
0
 protected void OnSightObjectSystemJustIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     AIPatrollingState.isPatrolling = false;
     SetAISpeedAttenuationFactor(AIMovementSpeedDefinition.RUN);
     SetAIDestination(new AIDestination {
         WorldPosition = IntersectedInteractiveObject.InteractiveGameObject.GetTransform().WorldPosition
     });
 }
Exemplo n.º 8
0
 public LevelCompletionZoneSystem(CoreInteractiveObject AssociatedInteractiveObject, LevelCompletionZoneSystemDefinition LevelCompletionZoneSystemDefinition,
                                  InteractiveObjectTagStruct ComparedInteractiveObjectTagStruct,
                                  Action <CoreInteractiveObject> OnLevelCompletionTriggerEnterPlayer)
 {
     LevelCompletionZoneObject = RangeObjectV2Builder.Build(AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent,
                                                            LevelCompletionZoneSystemDefinition.TriggerRangeObjectInitialization, AssociatedInteractiveObject, AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_LevelCompletionZoneListener");
     LevelCompletionZoneObject.RegisterPhysicsEventListener(new RangeObjectV2PhysicsEventListener_Delegated(ComparedInteractiveObjectTagStruct, OnLevelCompletionTriggerEnterPlayer));
 }
Exemplo n.º 9
0
 public LevelCompletionZoneSystem(CoreInteractiveObject AssociatedInteractiveObject, LevelCompletionZoneSystemDefinition LevelCompletionZoneSystemDefinition,
                                  Func <InteractiveObjectPhysicsTriggerInfo, bool> PhysicsEventListenerGuard,
                                  Action <CoreInteractiveObject> OnLevelCompletionTriggerEnterPlayer)
 {
     LevelCompletionZoneObject = RangeObjectV2Builder.Build(AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent,
                                                            LevelCompletionZoneSystemDefinition.TriggerRangeObjectInitialization, AssociatedInteractiveObject, AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_LevelCompletionZoneListener");
     LevelCompletionZoneObject.RegisterPhysicsEventListener(new InteractiveObjectPhysicsEventListenerDelegated(PhysicsEventListenerGuard, OnLevelCompletionTriggerEnterPlayer));
 }
Exemplo n.º 10
0
 private void OnSightNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     currentlyIntersectedInteractiveObjects.Remove(IntersectedInteractiveObject);
     if (OnSightObjectSystemNoMoreIntersected != null)
     {
         OnSightObjectSystemNoMoreIntersected.Invoke(IntersectedInteractiveObject);
     }
 }
Exemplo n.º 11
0
 private void OnSightJustIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     currentlyIntersectedInteractiveObjects.Add(IntersectedInteractiveObject);
     if (OnSightObjectSystemJustIntersected != null)
     {
         OnSightObjectSystemJustIntersected.Invoke(IntersectedInteractiveObject);
     }
 }
Exemplo n.º 12
0
        private void OnInteractiveObjectDestroyed(CoreInteractiveObject InteractiveObject)
        {
            InteractiveObjects.Remove(InteractiveObject);
            var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox();

            if (interactiveObjectLogicCollider != null)
            {
                InteractiveObjectsIndexedByLogicCollider.Remove(interactiveObjectLogicCollider);
            }
        }
Exemplo n.º 13
0
        private void OnInteractiveObjectCreated(CoreInteractiveObject InteractiveObject)
        {
            InteractiveObjects.Add(InteractiveObject);
            var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox();

            if (interactiveObjectLogicCollider != null)
            {
                InteractiveObjectsIndexedByLogicCollider.Add(interactiveObjectLogicCollider, InteractiveObject);
            }
        }
Exemplo n.º 14
0
 protected void OnSightObjectSystemNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     if (SightObjectSystem.CurrentlyIntersectedInteractiveObjects.Count > 0)
     {
         OnSightObjectSystemJustIntersected(SightObjectSystem.CurrentlyIntersectedInteractiveObjects[0]);
     }
     else
     {
         AIPatrollingState.isPatrolling = true;
     }
 }
Exemplo n.º 15
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,
            };
        }
Exemplo n.º 16
0
        private void OnInteractiveObjectCreated(CoreInteractiveObject InteractiveObject)
        {
            InteractiveObjects.Add(InteractiveObject);
            if (InteractiveObject.InteractiveGameObject != null)
            {
                var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.LogicCollider;
                if (interactiveObjectLogicCollider != null)
                {
                    InteractiveObjectsIndexedByLogicCollider.Add(interactiveObjectLogicCollider, InteractiveObject);
                }
            }

            InteractiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnInteractiveObjectDestroyed);
        }
Exemplo n.º 17
0
 public override List <ASequencedAction> GetSequencedActions(CoreInteractiveObject associatedInteractiveObject)
 {
     return(new List <ASequencedAction>()
     {
         new AIWarpActionV2(associatedInteractiveObject, this.StartPoint.WorldPoint, () => new List <ASequencedAction>()
         {
             new AIMoveToActionV2(associatedInteractiveObject, this.MovePoint.WorldPoint, this.MovePoint.AIMovementSpeed, () => new List <ASequencedAction>()
             {
                 new PlayContextAnimationAction(associatedInteractiveObject.AnimationController, this.Animation, () => new List <ASequencedAction>()
                 {
                     //   new AIMoveToActionV2(associatedInteractiveObject, this.EndPoint.WorldPoint, this.EndPoint.AIMovementSpeed, () => null)
                 })
             })
         })
     });
 }
Exemplo n.º 18
0
        public static float CalculateDesiredSpeed_Unscaled_Attenuated(ObjectSpeedCalculationType ObjectSpeedCalculationType,
                                                                      CoreInteractiveObject CoreInteractiveObject,
                                                                      AIMovementSpeedAttenuationFactor SpeedAttenuationFactor)
        {
            var SpeedMagnitude = 0f;

            if (ObjectSpeedCalculationType == ObjectSpeedCalculationType.AGENT)
            {
                var agent = CoreInteractiveObject.InteractiveGameObject.Agent;
                if (agent != null && agent.hasPath)
                {
                    SpeedMagnitude = AIMovementSpeedAttenuationFactors.AIMovementSpeedAttenuationFactorLookup[SpeedAttenuationFactor];
                }
            }

            return(SpeedMagnitude);
        }
Exemplo n.º 19
0
        public AttractiveObjectSystem(CoreInteractiveObject InteractiveObject, Func <InteractiveObjectTag, bool> physicsInteractionSelectionGuard, AttractiveObjectSystemDefinition AttractiveObjectSystemDefinition,
                                      Action <CoreInteractiveObject> onAttractiveSystemJustIntersected    = null,
                                      Action <CoreInteractiveObject> onAttractiveSystemJustNotIntersected = null, Action <CoreInteractiveObject> onAttractiveSystemInterestedNothing = null)
        {
            SphereRange = new SphereRangeObjectV2(InteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, new SphereRangeObjectInitialization
            {
                RangeTypeID = RangeTypeID.ATTRACTIVE_OBJECT_ACTIVE,
                IsTakingIntoAccountObstacles = true,
                SphereRangeTypeDefinition    = new SphereRangeTypeDefinition
                {
                    Radius = AttractiveObjectSystemDefinition.EffectRange
                }
            }, InteractiveObject, InteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_AttractiveObjectRange");
            IsAskingTobedestroyed = false;

            SphereRange.RegisterIntersectionEventListener(new InteractiveIntersectionListenerDelegated(SphereRange, physicsInteractionSelectionGuard, OnJustIntersectedAction: onAttractiveSystemJustIntersected,
                                                                                                       OnJustNotIntersectedAction: onAttractiveSystemJustNotIntersected, OnInterestedNothingAction: onAttractiveSystemInterestedNothing));
            AttractiveObjectLifetimeTimer = new AttractiveObjectLifetimeTimer(AttractiveObjectSystemDefinition.EffectiveTime);
        }
Exemplo n.º 20
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);
        }
Exemplo n.º 21
0
        public SightObjectSystem(CoreInteractiveObject AssocaitedInteractiveObject, SightObjectSystemDefinition SightObjectSystemDefinition, Func <InteractiveObjectTag, bool> PhysicsTagEventGuard,
                                 Action <CoreInteractiveObject> OnSightObjectSystemJustIntersected,
                                 Action <CoreInteractiveObject> OnSightObjectSystemIntersectedNothing,
                                 Action <CoreInteractiveObject> OnSightObjectSystemNoMoreIntersected)
        {
            this.OnSightObjectSystemJustIntersected   = OnSightObjectSystemJustIntersected;
            this.OnSightObjectSystemNoMoreIntersected = OnSightObjectSystemNoMoreIntersected;

            SightRange = new RoundedFrustumRangeObjectV2(AssocaitedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, new RoundedFrustumRangeObjectInitialization
            {
                IsTakingIntoAccountObstacles = true,
                RangeTypeID = RangeTypeID.SIGHT_VISION,
                RoundedFrustumRangeTypeDefinition = new RoundedFrustumRangeTypeDefinition
                {
                    FrustumV2 = SightObjectSystemDefinition.Frustum
                }
            }, AssocaitedInteractiveObject, AssocaitedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_SightObject");
            SightRange.RegisterIntersectionEventListener(new InteractiveIntersectionListenerDelegated(SightRange, PhysicsTagEventGuard,
                                                                                                      OnJustIntersectedAction: OnSightJustIntersected, OnInterestedNothingAction: OnSightObjectSystemIntersectedNothing, OnJustNotIntersectedAction: OnSightNoMoreIntersected));
        }
Exemplo n.º 22
0
 public void AddInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject)
 {
     InteractiveObjectDisarmingThisObject.Add(CoreInteractiveObject);
 }
Exemplo n.º 23
0
 /// <summary>
 /// Effective deflection of the concerned InteractiveObject
 /// </summary>
 /// <param name="DelfectionActorObject">It's the InteractiveObject that has triggered the deflection of the concerned InteractiveObject.</param>
 public virtual void InteractiveObjectDeflected(CoreInteractiveObject DelfectionActorObject)
 {
 }
Exemplo n.º 24
0
 /// <param name="DelfectionActorObject">It's the InteractiveObject that has triggered the deflection of the concerned InteractiveObject.</param>
 public virtual bool AskIfProjectileCanBeDeflected(CoreInteractiveObject DelfectionActorObject)
 {
     return(false);
 }
Exemplo n.º 25
0
 /// <summary>
 /// When the associated interactive object belongs to a weapon, then it's weapon reference is changed by <paramref name="NewWeaponHolder"/>.
 /// </summary>
 public virtual void SwitchWeaponHolder(CoreInteractiveObject NewWeaponHolder)
 {
 }
Exemplo n.º 26
0
 /// <param name="DamageDealerInteractiveObject">The reference to the <see cref="CoreInteractiveObject"/> that is provoking damages.</param>
 public virtual void DealDamage(float Damage, CoreInteractiveObject DamageDealerInteractiveObject)
 {
 }
Exemplo n.º 27
0
 public abstract List <ASequencedAction> GetSequencedActions(CoreInteractiveObject associatedInteractiveObject);
Exemplo n.º 28
0
 public void RemoveInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject)
 {
     InteractiveObjectDisarmingThisObject.Remove(CoreInteractiveObject);
 }
Exemplo n.º 29
0
 public CoreInteractiveObject Init()
 {
     this.CreatedCoreInteractiveObject = this.InitializationLogic();
     MonoBehaviour.Destroy(this);
     return(this.CreatedCoreInteractiveObject);
 }
Exemplo n.º 30
0
 private void OnLevelCompletionTriggerEnterPlayer(CoreInteractiveObject IntersectedInteractiveObject)
 {
     LevelAvailabilityTimelineEventManager.Get().OnLevelCompleted();
 }