CheckNewAction() public méthode

Checks if the action has just been triggered
public CheckNewAction ( InputAction action ) : bool
action InputAction The action to check
Résultat bool
 public override void HandleInput(InputManager input)
 {
     if (input.CheckNewAction(InputAction.Selection))
     {
         screenManager.ShowScreen(new ModelScreen());
     }
 }
        public override void HandleInput(InputManager input)
        {
            base.HandleInput(input);
            bool moveModel = false;
            Tile newTile = new Tile();
            if (input.CheckNewAction(InputAction.TileMoveUp))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Up);
            }
            if (input.CheckNewAction(InputAction.TileMoveDown))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Down);
            }
            if (input.CheckNewAction(InputAction.TileMoveLeft))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Left);
            }
            if (input.CheckNewAction(InputAction.TileMoveRight))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Right);
            }
            if (!newTile.IsNull())
                currentTile = newTile;

            if (input.CheckAction(InputAction.Selection))
            {
                AddUnit(new TestUnit(startBase.Position, goalBase));
                AddUnit(new TestUnit(goalBase.Position, startBase));
            }

            if (moveModel)
                myModel.SetPosition(currentTile.Position);

            if (input.CheckNewAction(InputAction.TowerBuild))
            {
                BuildTower(currentTile);
            }
        }
        public override void HandleInput(InputManager input)
        {
            base.HandleInput(input);
            bool moveModel = false;
            Tile newTile = new Tile();
            if (input.CheckNewAction(InputAction.TileMoveUp))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Up);
            }
            if (input.CheckNewAction(InputAction.TileMoveDown))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Down);
            }
            if (input.CheckNewAction(InputAction.TileMoveLeft))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Left);
            }
            if (input.CheckNewAction(InputAction.TileMoveRight))
            {
                moveModel = true;
                newTile = TileMap.GetTileNeighbor(currentTile, NeighborTile.Right);
            }
            if (!newTile.IsNull())
                currentTile = newTile;

            if(input.CheckNewAction(InputAction.Selection))
            {
                //units.Add(new TestUnit(startBase.GetTile().Position));
            }

            //if (input.CheckNewAction(InputAction.Selection))
            //{
            //    for (int i = 0; i < units.Count; i++)
            //    {
            //        units[i].SetPosition(new Vector3(rand.Next(-99, 99), 0, rand.Next(-99, 99)));
            //        units[i].GetTile();
            //    }
            //    //ScreenManager.Game.Exit();
            //}
            if (input.CheckAction(InputAction.RotateLeft))
            {
                cameraManager.RotateX(-0.03f);
            }
            if (input.CheckAction(InputAction.RotateRight))
            {
                cameraManager.RotateX(0.03f);
            }
            if (input.CheckAction(InputAction.RotateUp))
            {
                cameraManager.RotateY(0.01f);
            }
            if (input.CheckAction(InputAction.RotateDown))
            {
                cameraManager.RotateY(-0.01f);
            }
            if (input.CheckAction(InputAction.StrafeLeft))
            {
                cameraManager.StrafeX(-10.0f);
            }
            if (input.CheckAction(InputAction.StrafeRight))
            {
                cameraManager.StrafeX(10.0f);
            }
            if (input.CheckAction(InputAction.StrafeUp))
            {
                cameraManager.StrafeY(10.0f);
            }
            if (input.CheckAction(InputAction.StrafeDown))
            {
                cameraManager.StrafeY(-10.0f);
            }

            if (moveModel)
                myModel.SetPosition(currentTile.Position);

            if (input.CheckNewAction(InputAction.TowerBuild))
            {
                BuildTower(currentTile);
            }
        }
        public override void HandleInput(InputManager input)
        {
            // Move to the previous menu entry
            if (input.CheckNewAction(InputAction.MenuUp))
            {
                selectedEntry--;

                if (selectedEntry < 0)
                    selectedEntry = menuEntries.Count - 1;
            }

            // Move to the next menu entry
            if (input.CheckNewAction(InputAction.MenuDown))
            {
                selectedEntry++;

                if (selectedEntry >= menuEntries.Count)
                    selectedEntry = 0;
            }

            if (input.CheckNewAction(InputAction.MenuSelect))
                OnSelectEntry(selectedEntry);
            else if (input.CheckNewAction(InputAction.MenuCancel))
                OnCancel();
        }