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 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)); }
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 RecoveringHealthEmitterSystem(CoreInteractiveObject AssociatedInteractiveObject, RecoveringHealthEmitterSystemDefinitionStruct recoveringHealthEmitterSystemDefinitionStruct, Action OnHealthRecoveredCallback = null) { this.RecoveringHealthEmitterSystemDefinitionStruct = recoveringHealthEmitterSystemDefinitionStruct; this.OnHealthRecoveredCallback = OnHealthRecoveredCallback; this.RecoveringHealthRangeTrigger = RangeObjectV2Builder.Build(AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, recoveringHealthEmitterSystemDefinitionStruct.RecveringHealthTriggerDefinition, AssociatedInteractiveObject, "RecoveringHealthRangeTrigger"); this.RecoveringHealthRangeTrigger.RegisterPhysicsEventListener(new InteractiveObjectPhysicsEventListenerDelegated(this.PhysicsEventGuard, onTriggerEnterAction: this.OnTriggerEnter)); }
public SelectableObjectSystem(CoreInteractiveObject AssociatedInteractiveObject, SelectableObjectSystemDefinition SelectableObjectSystemDefinition, object AssociatedPlayerAction) //TODO -> replace object with RTPPlayerAction ref { this.AssociatedInteractiveObject = AssociatedInteractiveObject; this.AssociatedPlayerAction = AssociatedPlayerAction; SphereRange = new SphereRangeObjectV2(AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, new SphereRangeObjectInitialization() { RangeTypeID = RangeTypeID.NOT_DISPLAYED, IsTakingIntoAccountObstacles = false, SphereRangeTypeDefinition = new SphereRangeTypeDefinition { Radius = SelectableObjectSystemDefinition.SelectionRange } }, AssociatedInteractiveObject, AssociatedInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent.name + "_SelectionRangeTrigger"); SphereRange.RegisterPhysicsEventListener(new SelectableObjectPhysicsEventListener(OnPlayerTriggerInSelectionEnter, OnPlayerTriggerInSelectionExit)); }
public LevelChunkTrackerSystem(LevelChunkInteractiveObject AssociatedLevelChunkInteractiveObject, LevelChunkInteractiveObjectDefinition LevelChunkInteractiveObjectDefinition, Action <CoreInteractiveObject> OnLevelChunkTriggerEnterAction, Action <CoreInteractiveObject> OnLevelChunkTriggerExitAction) { this.LevelChunkTrackerRange = new BoxRangeObjectV2(AssociatedLevelChunkInteractiveObject.InteractiveGameObject.InteractiveGameObjectParent, new BoxRangeObjectInitialization() { BoxRangeTypeDefinition = new BoxRangeTypeDefinition() { Center = LevelChunkInteractiveObjectDefinition.LocalCenter, Size = LevelChunkInteractiveObjectDefinition.LocalSize }, RangeTypeID = RangeTypeID.NOT_DISPLAYED, IsTakingIntoAccountObstacles = false }, AssociatedLevelChunkInteractiveObject, nameof(LevelChunkTrackerSystem.LevelChunkTrackerRange)); this.LevelChunkTrackerRange.RegisterPhysicsEventListener( new InteractiveObjectPhysicsEventListenerDelegated((InteractiveObjectPhysicsTriggerInfo) => InteractiveObjectPhysicsTriggerInfo.GetOtherInteractiveObjectTag().IsPlayer, OnLevelChunkTriggerEnterAction, OnLevelChunkTriggerExitAction) ); }
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)); }