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, 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 override void Init() { interactiveObjectTag = new InteractiveObjectTag { IsAttractiveObject = true }; var physicsInteractionSelectionGuard = new InteractiveObjectTagStruct(isAi: 1); AttractiveObjectSystem = new AttractiveObjectSystem(this, physicsInteractionSelectionGuard, this.TestAttractiveObjectInitializerData.AttractiveObjectSystemDefinition, OnAssociatedAttractiveSystemJustIntersected, OnAssociatedAttractiveSystemNoMoreIntersected, OnAssociatedAttractiveSystemInterestedNothing); DisarmObjectSystem = new DisarmObjectSystem(this, this.TestAttractiveObjectInitializerData.DisarmSystemDefinition, new InteractiveObjectTagStruct { IsAi = 1 }, OnAssociatedDisarmObjectTriggerEnter, OnAssciatedDisarmObjectTriggerExit); SelectableObjectSystem = new SelectableObjectSystem(this, this.TestAttractiveObjectInitializerData.SelectableObjectSystemDefinition, this.TestAttractiveObjectInitializerData.SelectableGrabActionDefinition.BuildPlayerAction(PlayerInteractiveObjectManager.Get().PlayerInteractiveObject)); }
public AttractiveObjectSystem(CoreInteractiveObject InteractiveObject, InteractiveObjectTagStruct 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 RangeIntersectionV2Listener_Delegated(SphereRange, physicsInteractionSelectionGuard, OnJustIntersectedAction: onAttractiveSystemJustIntersected, OnJustNotIntersectedAction: onAttractiveSystemJustNotIntersected, OnInterestedNothingAction: onAttractiveSystemInterestedNothing)); AttractiveObjectLifetimeTimer = new AttractiveObjectLifetimeTimer(AttractiveObjectSystemDefinition.EffectiveTime); }
public SightObjectSystem(CoreInteractiveObject AssocaitedInteractiveObject, SightObjectSystemDefinition SightObjectSystemDefinition, InteractiveObjectTagStruct 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 RangeIntersectionV2Listener_Delegated(SightRange, PhysicsTagEventGuard, OnJustIntersectedAction: OnSightJustIntersected, OnInterestedNothingAction: OnSightObjectSystemIntersectedNothing, OnJustNotIntersectedAction: OnSightNoMoreIntersected)); }