Beispiel #1
0
    public void CheckForInput()
    {
        if (GamepadInput.GetDown(InputOption.B_BUTTON))
        {
            Debug.Log("B button was pressed down! Going back one level.");

            SceneManager.LoadScene("Main");
        }

        if (GamepadInput.GetDown(InputOption.START_BUTTON))
        {
            Debug.Log("The start button was pressed down! Going back to Main Menu");

            SceneManager.LoadScene("Main");
        }

        if (GamepadInput.Get(InputOption.LEFT_STICK_HORIZONTAL))
        {
            float stickValue = GamepadInput.GetInputValue(InputOption.LEFT_STICK_HORIZONTAL);

            if (stickValue > 0)
            {
                Debug.Log("Left analog stick pushed to the right!");
            }
            else if (stickValue < 0)
            {
                Debug.Log("Left analog stick pushed to the left!");
            }
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        // The platform should only move if no POI is selected and the bookmarks aren't being used.
        if (POIManager.selectedPOI == null && !BookmarkController.bookmarkPanelActive)
        {
            // Rotates the platform horizontally.
            if (GamepadInput.Get(horizontalRotationInput))
            {
                RotatePlatformHorizontally(GamepadInput.GetInputValue(horizontalRotationInput));
            }

            // Rotates the platform vertically.
            if (GamepadInput.Get(verticalRotationInput))
            {
                RotatePlatformVertically(GamepadInput.GetInputValue(verticalRotationInput));
            }

            // Moves the platform horizontally.
            if (GamepadInput.Get(horizontalMovementInput))
            {
                MovePlatform(GamepadInput.GetInputValue(horizontalMovementInput), transform.right);
            }

            // Moves the platform forward.
            if (GamepadInput.Get(forwardMovementInput))
            {
                MovePlatform(GamepadInput.GetInputValue(forwardMovementInput), transform.forward);
            }
        }
    }
Beispiel #3
0
    public void CheckForInput()
    {
        if (GamepadInput.GetDown(InputOption.A_BUTTON))
        {
            Debug.Log("A button was pressed down!");
        }

        if (GamepadInput.Get(InputOption.A_BUTTON))
        {
            Debug.Log("A button is being held down!");
        }

        if (GamepadInput.GetUp(InputOption.A_BUTTON))
        {
            Debug.Log("A button was released!");
        }

        if (GamepadInput.Get(InputOption.LEFT_STICK_HORIZONTAL))
        {
            float stickValue = GamepadInput.GetInputValue(InputOption.LEFT_STICK_HORIZONTAL);

            if (stickValue > 0)
            {
                Debug.Log("Left analog stick pushed to the right!");
            }
            else if (stickValue < 0)
            {
                Debug.Log("Left analog stick pushed to the left!");
            }
        }

        if (GamepadInput.Get(InputOption.RIGHT_STICK_VERTICAL))
        {
            float stickValue = GamepadInput.GetInputValue(InputOption.RIGHT_STICK_VERTICAL);

            if (stickValue > 0)
            {
                Debug.Log("Right stick pushed up!");
            }
            else if (stickValue < 0)
            {
                Debug.Log("Right stick pushed down!");
            }
        }
    }
Beispiel #4
0
 public void CheckForMove()
 {
     if (GamepadInput.Get(InputOption.RIGHT_STICK_HORIZONTAL))
     {
         OnRightHorizontal(GamepadInput.GetInputValue(InputOption.RIGHT_STICK_HORIZONTAL));
     }
     if (GamepadInput.Get(InputOption.RIGHT_STICK_VERTICAL))
     {
         OnRightVertical(GamepadInput.GetInputValue(InputOption.RIGHT_STICK_VERTICAL));
     }
     if (GamepadInput.Get(InputOption.LEFT_STICK_HORIZONTAL))
     {
         OnLeftHorizontal(GamepadInput.GetInputValue(InputOption.LEFT_STICK_HORIZONTAL));
     }
     if (GamepadInput.Get(InputOption.LEFT_STICK_VERTICAL))
     {
         OnLeftVertical(GamepadInput.GetInputValue(InputOption.LEFT_STICK_VERTICAL));
     }
 }