예제 #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!");
            }
        }
    }
예제 #2
0
    public void MovePhotosOnInput(GamepadInput.InputOption input)
    {
        float stickValue = GamepadInput.GetInputValue(input);

        if (input == GamepadInput.InputOption.LEFT_STICK_HORIZONTAL || input == GamepadInput.InputOption.RIGHT_STICK_HORIZONTAL)
        {
            if (stickValue < 0)
            {
                MoveLeft();
            }
            else
            {
                MoveRight();
            }
        }
        else if (input == GamepadInput.InputOption.LEFT_STICK_VERTICAL || input == GamepadInput.InputOption.RIGHT_STICK_VERTICAL)
        {
            if (stickValue < 0)
            {
                MoveDown();
            }
            else
            {
                MoveUp();
            }
        }
    }
예제 #3
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);
            }
        }
    }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        // If the A button is pressed, select the active button.
        if (GamepadInput.GetDown(InputOption.A_BUTTON))
        {
            // If there's no selected element, we first must choose a site. Otherwise, select the data type.
            if (selectedElementIndex < 0)
            {
                SelectSiteButton(siteButtons[selectedSiteIndex]);
            }
            else
            {
                SelectSiteSetButton(siteElementButtons[selectedElementIndex]);
            }
        }

        // If B is pressed, go back and deselect the active element.
        if (GamepadInput.GetDown(InputOption.B_BUTTON))
        {
            ClearElementButtons();
        }

        // If the right stick is pushed, move buttons left or right.
        if (GamepadInput.GetDown(InputOption.LEFT_STICK_HORIZONTAL))
        {
            // The direction of the stick. Helps us determine what direction it was pushed.
            float stickValue = GamepadInput.GetInputValue(InputOption.LEFT_STICK_HORIZONTAL);

            // If pushed to the right, move selected button to the right.
            if (stickValue > 0)
            {
                // If there's no selected element, move the site buttons. Otherwise move the data type buttons.
                if (selectedElementIndex < 0)
                {
                    MoveSiteButtons(1);
                }
                else
                {
                    MoveElementButtons(1);
                }
            }

            // If pushed to the left, move selected button to the left.
            else if (stickValue < 0)
            {
                if (selectedElementIndex < 0)
                {
                    MoveSiteButtons(-1);
                }
                else
                {
                    MoveElementButtons(-1);
                }
            }
        }
    }
예제 #5
0
    public void Update()
    {
        if (monitorButtonsActive && !PhotoController.photosActive && !PhotoController.photosLoading)
        {
            if (readyForInput == false)
            {
                if (GamepadInput.GetUp(GamepadInput.InputOption.A_BUTTON))
                {
                    readyForInput = true;
                }
            }

            if (GamepadInput.GetDown(GamepadInput.InputOption.A_BUTTON) && readyForInput)
            {
                monitorButtons[selectedButtonIndex].ToggleButton();
            }

            if (GamepadInput.GetDown(GamepadInput.InputOption.LEFT_STICK_HORIZONTAL))
            {
                float value = GamepadInput.GetInputValue(GamepadInput.InputOption.LEFT_STICK_HORIZONTAL);

                if (value < 0)
                {
                    SelectNextButton(-1);
                }
                else if (value > 0)
                {
                    SelectNextButton(1);
                }
            }

            else if (GamepadInput.GetDown(GamepadInput.InputOption.RIGHT_STICK_HORIZONTAL))
            {
                float value = GamepadInput.GetInputValue(GamepadInput.InputOption.RIGHT_STICK_HORIZONTAL);

                if (value < 0)
                {
                    SelectNextButton(-1);
                }
                else if (value > 0)
                {
                    SelectNextButton(1);
                }
            }
        }
    }
예제 #6
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!");
            }
        }
    }
예제 #7
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));
     }
 }
예제 #8
0
    private void Update()
    {
        if (GamepadInput.GetDown(GamepadInput.InputOption.LEFT_TRIGGER))
        {
            if (bookmarkPanelActive)
            {
                MovePanelDown();
            }
            else
            {
                MovePanelUp();
            }
        }

        if (bookmarkPanelActive && !PlatformMonitor.monitorButtonsActive)
        {
            if (GamepadInput.GetDown(GamepadInput.InputOption.LEFT_STICK_VERTICAL))
            {
                float stickValue = GamepadInput.GetInputValue(GamepadInput.InputOption.LEFT_STICK_VERTICAL);

                if (stickValue < 0)
                {
                    MoveSelectorDown();
                }

                else
                {
                    MoveSelectorUp();
                }
            }

            if (GamepadInput.GetDown(GamepadInput.InputOption.A_BUTTON))
            {
                SelectBookmark();
            }
        }
    }