public void OnInteractiveObjectCreated(CoreInteractiveObject CoreInteractiveObject) { if (OnAllInteractiveObjectCreatedEvent != null) { OnAllInteractiveObjectCreatedEvent.Invoke(CoreInteractiveObject); } }
private void OnInteractiveObjectdestroyed(CoreInteractiveObject interactiveObject) { if (this.InsideInteractiveObjects.Remove(interactiveObject)) { this.ClearReferencesOfRemovedInteractiveObject(interactiveObject); } }
public void OnInteractiveObjectDestroyed(CoreInteractiveObject CoreInteractiveObject) { if (OnInteractiveObjectDestroyedEvent != null) { OnInteractiveObjectDestroyedEvent.Invoke(CoreInteractiveObject); } }
public void RemoveInteractiveObject(CoreInteractiveObject interactiveObject) { if (this.InsideInteractiveObjects.Remove(interactiveObject)) { ClearReferencesOfRemovedInteractiveObject(interactiveObject); } }
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; }
public void AddInteractiveObject(CoreInteractiveObject interactiveObject) { if (this.InsideInteractiveObjects.Add(interactiveObject)) { interactiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnInteractiveObjectdestroyed); this.OnInteractiveObjectJustAdded?.Invoke(interactiveObject); } }
protected void OnSightObjectSystemJustIntersected(CoreInteractiveObject IntersectedInteractiveObject) { AIPatrollingState.isPatrolling = false; SetAISpeedAttenuationFactor(AIMovementSpeedDefinition.RUN); SetAIDestination(new AIDestination { WorldPosition = IntersectedInteractiveObject.InteractiveGameObject.GetTransform().WorldPosition }); }
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)); }
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)); }
private void OnSightNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject) { currentlyIntersectedInteractiveObjects.Remove(IntersectedInteractiveObject); if (OnSightObjectSystemNoMoreIntersected != null) { OnSightObjectSystemNoMoreIntersected.Invoke(IntersectedInteractiveObject); } }
private void OnSightJustIntersected(CoreInteractiveObject IntersectedInteractiveObject) { currentlyIntersectedInteractiveObjects.Add(IntersectedInteractiveObject); if (OnSightObjectSystemJustIntersected != null) { OnSightObjectSystemJustIntersected.Invoke(IntersectedInteractiveObject); } }
private void OnInteractiveObjectDestroyed(CoreInteractiveObject InteractiveObject) { InteractiveObjects.Remove(InteractiveObject); var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox(); if (interactiveObjectLogicCollider != null) { InteractiveObjectsIndexedByLogicCollider.Remove(interactiveObjectLogicCollider); } }
private void OnInteractiveObjectCreated(CoreInteractiveObject InteractiveObject) { InteractiveObjects.Add(InteractiveObject); var interactiveObjectLogicCollider = InteractiveObject.InteractiveGameObject.GetLogicColliderAsBox(); if (interactiveObjectLogicCollider != null) { InteractiveObjectsIndexedByLogicCollider.Add(interactiveObjectLogicCollider, InteractiveObject); } }
protected void OnSightObjectSystemNoMoreIntersected(CoreInteractiveObject IntersectedInteractiveObject) { if (SightObjectSystem.CurrentlyIntersectedInteractiveObjects.Count > 0) { OnSightObjectSystemJustIntersected(SightObjectSystem.CurrentlyIntersectedInteractiveObjects[0]); } else { AIPatrollingState.isPatrolling = true; } }
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, }; }
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); }
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) }) }) }) }); }
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); }
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); }
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); }
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)); }
public void AddInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject) { InteractiveObjectDisarmingThisObject.Add(CoreInteractiveObject); }
/// <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) { }
/// <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); }
/// <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) { }
/// <param name="DamageDealerInteractiveObject">The reference to the <see cref="CoreInteractiveObject"/> that is provoking damages.</param> public virtual void DealDamage(float Damage, CoreInteractiveObject DamageDealerInteractiveObject) { }
public abstract List <ASequencedAction> GetSequencedActions(CoreInteractiveObject associatedInteractiveObject);
public void RemoveInteractiveObjectDisarmingThisObject(CoreInteractiveObject CoreInteractiveObject) { InteractiveObjectDisarmingThisObject.Remove(CoreInteractiveObject); }
public CoreInteractiveObject Init() { this.CreatedCoreInteractiveObject = this.InitializationLogic(); MonoBehaviour.Destroy(this); return(this.CreatedCoreInteractiveObject); }
private void OnLevelCompletionTriggerEnterPlayer(CoreInteractiveObject IntersectedInteractiveObject) { LevelAvailabilityTimelineEventManager.Get().OnLevelCompleted(); }