Exemplo n.º 1
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.º 2
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.º 3
0
        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));
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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));
        }