Example #1
0
        public override void Tick(float d)
        {
            if (!this.target.IsAskingToBeDestroyed)
            {
                TargetCursorManager.Get().SetTargetCursorPosition(Camera.main.WorldToScreenPoint(
                                                                      this.target.InteractiveGameObject.GetLocalToWorld().MultiplyPoint(this.target.GetFiringTargetLocalPosition())));
            }

            if (this.firingInteractiveObject.GetCurrentlyTargettedInteractiveObject() != target)
            {
                GameTestMockedInputManager.MockedInstance.GetGameTestMockedXInput().GameTestInputMockedValues.SwitchSelectionButtonD = true;
            }
            else
            {
                GameTestMockedInputManager.MockedInstance.GetGameTestMockedXInput().GameTestInputMockedValues.SwitchSelectionButtonD = false;
            }

            this.TargetIsCorrect = (this.firingInteractiveObject.GetCurrentlyTargettedInteractiveObject() == target);

            if (this.target.IsAskingToBeDestroyed)
            {
                this.TargetIsCorrect = true;
            }

            if (this.TargetIsCorrect)
            {
                TargetAndFireTestUtil.SetupInputForStoppingFiring();
            }
        }
Example #2
0
        private IEnumerator LocalCoroutine()
        {
            TargetCursorManager.Get().SetTargetCursorPosition(Camera.main.WorldToScreenPoint(
                                                                  this.Target.InteractiveGameObject.GetLocalToWorld().MultiplyPoint(this.Target.InteractiveGameObject.AverageModelLocalBounds.Bounds.center)));
            yield return(null);

            this.ended = true;
        }
Example #3
0
 public override void Tick(float d)
 {
     if (!this.Target.IsAskingToBeDestroyed)
     {
         TargetCursorManager.Get().SetTargetCursorPosition(Camera.main.WorldToScreenPoint(
                                                               this.Target.InteractiveGameObject.GetLocalToWorld().MultiplyPoint(this.Target.GetFiringTargetLocalPosition())));
     }
 }
Example #4
0
 public DashPathCalculationSystem(CoreInteractiveObject associatedInteractiveObject,
                                  PlayerDashTeleportationDirectionActionDefinition DashTeleportationDirectionActionDefinition, TargetCursorManager targetCursorManagerRef, Camera mainCamera) : this()
 {
     AssociatedInteractiveObject = associatedInteractiveObject;
     this.DashTeleportationDirectionActionDefinition = DashTeleportationDirectionActionDefinition;
     TargetCursorManagerRef = targetCursorManagerRef;
     MainCamera             = mainCamera;
 }
Example #5
0
        private IEnumerator ActionCoroutine()
        {
            TargetAndFireTestUtil.SetupInputForStartingFiring();
            TargetCursorManager.Get().SetTargetCursorPosition(Camera.main.WorldToScreenPoint(
                                                                  this.Target.InteractiveGameObject.GetLocalToWorld().MultiplyPoint(this.Target.InteractiveGameObject.AverageModelLocalBounds.Bounds.center)));
            yield return(null);

            TargetAndFireTestUtil.SetupInputForStoppingFiring();
            this.ended = true;
        }
Example #6
0
        public PlayerDashDirectionAction(CoreInteractiveObject associatedInteractiveObject,
                                         PlayerDashTeleportationDirectionActionDefinition DashTeleportationDirectionActionDefinition,
                                         CoreInteractiveObjectActionDefinition coreInteractiveObjectActionDefinition) : base(coreInteractiveObjectActionDefinition)
        {
            var targetCursormManagerRef = TargetCursorManager.Get();
            var mainCamera = Camera.main;

            this.DashPathCalculationSystem    = new DashPathCalculationSystem(associatedInteractiveObject, DashTeleportationDirectionActionDefinition, targetCursormManagerRef, mainCamera);
            this.DashPathVisualFeedbackSystem = new DashPathVisualFeedbackSystem(PlayerDashConfigurationGameObject.Get());

            this.Tick(0f);
        }
Example #7
0
        public FiringPlayerActionTargetSystem(PlayerAimingInteractiveObjectActionInherentData playerAimingInteractiveObjectActionInherentDataRef, CoreInteractiveObject firingInteractiveObject, TargetCursorManager targetCursorManagerRef)
        {
            this._targetCursorManagerRef     = targetCursorManagerRef;
            this.FiringInteractiveObject     = firingInteractiveObject;
            this.TargetPlaneGameObject       = GameObject.Instantiate(playerAimingInteractiveObjectActionInherentDataRef.FiringHorizontalPlanePrefab);
            this.TargetPlaneGameObject.layer = LayerMask.NameToLayer(LayerConstants.FIRING_ACTION_HORIZONTAL_LAYER);
            this.DottedVisualFeeback         = GameObject.Instantiate(playerAimingInteractiveObjectActionInherentDataRef.GroundConeVisualFeedbackPrefab);

            /// Until it's first update, the DottedVisualFeeback is set far away from screen.
            this.DottedVisualFeeback.transform.position = new Vector3(99999f, 99999f, 99999f);

            this.CurrentlyTargettedInteractiveObject = new ObjectVariable <CoreInteractiveObject>(this.OnCurrentlyTargettedInteractiveObjectChange);
        }
Example #8
0
        public override ASequencedAction[] BuildScenarioActions()
        {
            CoreInteractiveObject targettedObject0 = null;
            CoreInteractiveObject targettedObject1 = null;
            CoreInteractiveObject targettedObject2 = null;

            IEM_ProjectileFireActionInput_Retriever playerInteractiveObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject;

            foreach (var io in InteractiveObjectV2Manager.Get().InteractiveObjects)
            {
                if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName0)
                {
                    targettedObject0 = io;
                }

                if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName1)
                {
                    targettedObject1 = io;
                }

                if (io.InteractiveGameObject.GetAssociatedGameObjectName() == TestTargettedObjectName2)
                {
                    targettedObject2 = io;
                }
            }

            GameObject AimPhysicsTestPoint0Object = GameObject.Find(AimPhysicsTestPoint0);
            GameObject AimPhysicsTestPoint1Object = GameObject.Find(AimPhysicsTestPoint1);


            return(new ASequencedAction[]
            {
                new EnsureTargetLockAction(playerInteractiveObject, targettedObject0)
                .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject0, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject0.IsAskingToBeDestroyed))
                      .Then(new EnsureTargetLockAction(playerInteractiveObject, targettedObject1)
                            .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject1, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject1.IsAskingToBeDestroyed))
                                  .Then(new EnsureTargetLockAction(playerInteractiveObject, targettedObject2)
                                        .Then(new Target_FireInteractiveObject_AndWait_Action(targettedObject2, new Target_FireInteractiveObject_AndWait_ActionDefintion(() => targettedObject2.IsAskingToBeDestroyed))
                                              .Then(new WaitForSecondsAction(0.5f)
                                                    .Then(new TimeFreezePressedAction()
                                                          .Then(new StartAimingAction()
                                                                .Then(new MoveTargetCursorSmoothScreenPosition(
                                                                          new MoveTargetCursorSmoothScreenPositionData(Camera.main.ScreenToViewportPoint(TargetCursorManager.Get().GetTargetCursorScreenPosition()), Camera.main.WorldToViewportPoint(AimPhysicsTestPoint0Object.transform.position), 0.1f))
                                                                      .Then(new StopAimingAction()
                                                                            .Then(new TimeFreezePressedAction()
                                                                                  .Then(new StartAimingAction()
                                                                                        .Then(new MoveTargetCursorSmoothScreenPosition(
                                                                                                  new MoveTargetCursorSmoothScreenPositionData(new Vector2(0.5f, 0.5f), Camera.main.WorldToViewportPoint(AimPhysicsTestPoint0Object.transform.position), 0.1f)))
                                                                                        )
                                                                                  )
                                                                            )
                                                                      )
                                                                ))
                                                    )
                                              )
                                        )
                                  )
                            )
                      )
            });
        }
Example #9
0
        public PlayerAimingInteractiveObjectAction(ref FiringInteractiveObjectActionInput firingInteractiveObjectActionInput) :
            base(firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData.coreInteractiveObjectActionDefinition)
        {
            this.FiringInteractiveObject = firingInteractiveObjectActionInput.firingInteractiveObject;

            var gameInputManager = GameInputManager.Get();

            this._playerAimingInteractiveObjectActionInherentData = firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData;

            this.FiringPlayerActionTargetSystem           = new FiringPlayerActionTargetSystem(this._playerAimingInteractiveObjectActionInherentData, this.FiringInteractiveObject, TargetCursorManager.Get());
            this.PlayerObjectOrientationSystem            = new PlayerObjectOrientationSystem(this.FiringInteractiveObject as IPlayerInteractiveObject, this.FiringPlayerActionTargetSystem);
            this.InteractiveObjectTargettedVisualFeedback = new InteractiveObjectTargettedVisualFeedback(firingInteractiveObjectActionInput.PlayerAimingInteractiveObjectActionInherentData, Camera.main);

            this.ExitActionSystem = new ExitActionSystem(gameInputManager);

            this._firingLockSelectionSystem = new FiringLockSelectionSystem(this.OnInteractiveObjectTargetted);


            /// Initialisation of states
            this.Tick(0f);
            this.AfterTicks(0f);
        }