コード例 #1
0
 public void OnInteractiveObjectCreated(CoreInteractiveObject CoreInteractiveObject)
 {
     if (OnAllInteractiveObjectCreatedEvent != null)
     {
         OnAllInteractiveObjectCreatedEvent.Invoke(CoreInteractiveObject);
     }
 }
コード例 #2
0
 private void OnInteractiveObjectdestroyed(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Remove(interactiveObject))
     {
         this.ClearReferencesOfRemovedInteractiveObject(interactiveObject);
     }
 }
コード例 #3
0
 public void OnInteractiveObjectDestroyed(CoreInteractiveObject CoreInteractiveObject)
 {
     if (OnInteractiveObjectDestroyedEvent != null)
     {
         OnInteractiveObjectDestroyedEvent.Invoke(CoreInteractiveObject);
     }
 }
コード例 #4
0
 public void RemoveInteractiveObject(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Remove(interactiveObject))
     {
         ClearReferencesOfRemovedInteractiveObject(interactiveObject);
     }
 }
コード例 #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;
        }
コード例 #6
0
 public void AddInteractiveObject(CoreInteractiveObject interactiveObject)
 {
     if (this.InsideInteractiveObjects.Add(interactiveObject))
     {
         interactiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnInteractiveObjectdestroyed);
         this.OnInteractiveObjectJustAdded?.Invoke(interactiveObject);
     }
 }
コード例 #7
0
 protected void OnSightObjectSystemJustIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     AIPatrollingState.isPatrolling = false;
     SetAISpeedAttenuationFactor(AIMovementSpeedDefinition.RUN);
     SetAIDestination(new AIDestination {
         WorldPosition = IntersectedInteractiveObject.InteractiveGameObject.GetTransform().WorldPosition
     });
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #10
0
 private void OnSightNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     currentlyIntersectedInteractiveObjects.Remove(IntersectedInteractiveObject);
     if (OnSightObjectSystemNoMoreIntersected != null)
     {
         OnSightObjectSystemNoMoreIntersected.Invoke(IntersectedInteractiveObject);
     }
 }
コード例 #11
0
 private void OnSightJustIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     currentlyIntersectedInteractiveObjects.Add(IntersectedInteractiveObject);
     if (OnSightObjectSystemJustIntersected != null)
     {
         OnSightObjectSystemJustIntersected.Invoke(IntersectedInteractiveObject);
     }
 }
コード例 #12
0
        private void OnInteractiveObjectDestroyed(CoreInteractiveObject InteractiveObject)
        {
            InteractiveObjects.Remove(InteractiveObject);
            var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox();

            if (interactiveObjectLogicCollider != null)
            {
                InteractiveObjectsIndexedByLogicCollider.Remove(interactiveObjectLogicCollider);
            }
        }
コード例 #13
0
        private void OnInteractiveObjectCreated(CoreInteractiveObject InteractiveObject)
        {
            InteractiveObjects.Add(InteractiveObject);
            var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox();

            if (interactiveObjectLogicCollider != null)
            {
                InteractiveObjectsIndexedByLogicCollider.Add(interactiveObjectLogicCollider, InteractiveObject);
            }
        }
コード例 #14
0
 protected void OnSightObjectSystemNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject)
 {
     if (SightObjectSystem.CurrentlyIntersectedInteractiveObjects.Count > 0)
     {
         OnSightObjectSystemJustIntersected(SightObjectSystem.CurrentlyIntersectedInteractiveObjects[0]);
     }
     else
     {
         AIPatrollingState.isPatrolling = true;
     }
 }
コード例 #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,
            };
        }
コード例 #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);
        }
コード例 #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)
                 })
             })
         })
     });
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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));
        }
コード例 #22
0
 public void AddInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject)
 {
     InteractiveObjectDisarmingThisObject.Add(CoreInteractiveObject);
 }
コード例 #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)
 {
 }
コード例 #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);
 }
コード例 #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)
 {
 }
コード例 #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)
 {
 }
コード例 #27
0
 public abstract List <ASequencedAction> GetSequencedActions(CoreInteractiveObject associatedInteractiveObject);
コード例 #28
0
 public void RemoveInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject)
 {
     InteractiveObjectDisarmingThisObject.Remove(CoreInteractiveObject);
 }
コード例 #29
0
 public CoreInteractiveObject Init()
 {
     this.CreatedCoreInteractiveObject = this.InitializationLogic();
     MonoBehaviour.Destroy(this);
     return(this.CreatedCoreInteractiveObject);
 }
コード例 #30
0
 private void OnLevelCompletionTriggerEnterPlayer(CoreInteractiveObject IntersectedInteractiveObject)
 {
     LevelAvailabilityTimelineEventManager.Get().OnLevelCompleted();
 }