void Update()
 {
     if ((Input.GetKeyDown(KeyCode.Escape) ||
          Input.GetKeyDown(KeyCode.P) ||
          contSupp.ControllerMenuRight("down")) &&
         !bIsModeSelector)
     {
         Toggle();
     }
 }
Ejemplo n.º 2
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape) ||
            contSupp.ControllerMenuRight("up") ||
            (bPauseActive &&
             (touches.bBaction ||
              contSupp.ControllerButtonPadRight("up"))))
        {
            if (controlsMenu.transform.localScale == Vector3.one)
            {
                Controls(false);
            }
            else if (soundMenu.transform.localScale == Vector3.one)
            {
                Sound(false);
            }
            else if (itemMenuCanvas.alpha == 1)
            {
                // "Unlock" Joystick from horizontal direction
                fixedJoy.joystickMode = JoystickMode.AllAxis;

                stuffBack.localScale          = Vector3.one;
                itemMenuCanvas.alpha          = 0;
                itemMenuCanvas.interactable   = false;
                itemMenuCanvas.blocksRaycasts = false;
            }
            else if (stuffMenu.transform.localScale == Vector3.one)
            {
                Stuff(false);
            }
            else if (bIsGWC &&
                     iconsMenu.transform.localScale == Vector3.one)
            {
                Icons(false);
            }
            else
            {
                Pause();
            }

            if (touches.bBaction)
            {
                touches.bBaction = false;
            }
        }
    }
    void Update()
    {
        if (itemMenu.gameObject.GetComponent <CanvasGroup>().alpha == 1)
        {
            // Controller Support
            if (contSupp.ControllerDirectionalPadHorizontal() == 0 &&
                contSupp.ControllerLeftJoystickHorizontal() == 0 &&
                joystick.Horizontal == 0 &&
                (!touches.bLeft &&
                 !touches.bRight))
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() > 0 ||
                      joystick.Horizontal > 0 ||
                      touches.bRight))
            {
                bControllerRight       = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() < 0 ||
                      joystick.Horizontal < 0 ||
                      touches.bLeft))
            {
                bControllerLeft        = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.D) ||
                Input.GetKeyDown(KeyCode.RightArrow) ||
                bControllerRight)
            {
                bControllerRight = false;

                if (currentPosition == ItemArrowPos.Use)
                {
                    currentPosition = ItemArrowPos.Drop;
                    ClearAllArrows();
                    DropArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                }
                else if (currentPosition == ItemArrowPos.Drop)
                {
                    currentPosition = ItemArrowPos.Back;
                    ClearAllArrows();
                    BackArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                }
            }
            else if (Input.GetKeyDown(KeyCode.A) ||
                     Input.GetKeyDown(KeyCode.LeftArrow) ||
                     bControllerLeft)
            {
                bControllerLeft = false;

                if (currentPosition == ItemArrowPos.Back)
                {
                    currentPosition = ItemArrowPos.Drop;
                    ClearAllArrows();
                    DropArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                }
                else if (currentPosition == ItemArrowPos.Drop)
                {
                    currentPosition = ItemArrowPos.Use;
                    ClearAllArrows();
                    UseArw.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                }
            }
            else if (Input.GetButtonDown("Action") ||
                     contSupp.ControllerButtonPadBottom("down") ||
                     touches.bAaction)
            {
                if (currentPosition == ItemArrowPos.Use)
                {
                    UseBtn.onClick.Invoke();
                }
                else if (currentPosition == ItemArrowPos.Drop)
                {
                    DropBtn.onClick.Invoke();
                }
                else if (currentPosition == ItemArrowPos.Back)
                {
                    BackBtn.onClick.Invoke();
                }

                moveSMA.bAllowSelection = false;
                moveSMA.bAvoidAllower   = false;
                touches.bAaction        = false;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction") ||
                     touches.bBaction)
            {
                ResetArrowPos();
            }
        }
    }
    void Update()
    {
        if (bDelayAction)
        {
            bDelayAction = false;
            return;
        }

        if (pauseMenu.localScale == Vector3.one &&
            pauseScreen.localScale == Vector3.one &&
            itemMenuAlpha.alpha == 0)
        {
            // Controller Support
            if (contSupp.ControllerDirectionalPadVertical() == 0 &&
                contSupp.ControllerLeftJoystickVertical() == 0 &&
                joystick.Vertical == 0 &&
                (!touches.bDown &&
                 !touches.bUp))
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0 ||
                      joystick.Vertical < 0 ||
                      touches.bDown))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0 ||
                      joystick.Vertical > 0 ||
                      touches.bUp))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                MoveDown();
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                MoveUp();
            }
            else if (Input.GetButtonDown("Action") ||
                     contSupp.ControllerButtonPadBottom("down") ||
                     touches.bAaction)
            {
                SelectOption();
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction") ||
                     touches.bBaction)
            {
                SaveBtn.GetComponentInChildren <Text>().text = "Save";
                ResetArrows();
            }
        }
    }
Ejemplo n.º 5
0
    void Update()
    {
        if (controlsMenu.localScale == Vector3.one)
        {
            // Controller Support
            if (!contSupp.bIsMoving &&
                fixedJoystick.Vertical == 0 &&
                fixedJoystick.Horizontal == 0 &&
                (!touches.bDown &&
                 !touches.bUp &&
                 !touches.bLeft &&
                 !touches.bRight))
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0 ||
                      touches.bDown ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical < 0)))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0 ||
                      touches.bUp ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical > 0)))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() > 0 ||
                      fixedJoystick.Horizontal > 0 ||
                      touches.bRight))
            {
                bControllerRight       = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() < 0 ||
                      fixedJoystick.Horizontal < 0 ||
                      touches.bLeft))
            {
                bControllerLeft        = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                if (currentPosition == SelectorPosition.showButtons)
                {
                    currentPosition = SelectorPosition.opacitySlider;
                    ClearAllSelectors();
                    buttonOpacitySelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.opacitySlider)
                {
                    currentPosition = SelectorPosition.dPad;
                    ClearAllSelectors();
                    dPadSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.dPad)
                {
                    currentPosition = SelectorPosition.vibrate;
                    ClearAllSelectors();
                    vibrateSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.vibrate)
                {
                    currentPosition = SelectorPosition.description;
                    ClearAllSelectors();
                    controlsDescriptionSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.description)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.showButtons;
                    ClearAllSelectors();
                    showButtonsSelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.description;
                    ClearAllSelectors();
                    controlsDescriptionSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.description)
                {
                    currentPosition = SelectorPosition.vibrate;
                    ClearAllSelectors();
                    vibrateSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.vibrate)
                {
                    currentPosition = SelectorPosition.dPad;
                    ClearAllSelectors();
                    dPadSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.dPad)
                {
                    currentPosition = SelectorPosition.opacitySlider;
                    ClearAllSelectors();
                    buttonOpacitySelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.opacitySlider)
                {
                    currentPosition = SelectorPosition.showButtons;
                    ClearAllSelectors();
                    showButtonsSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.showButtons)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.A) ||
                     Input.GetKeyDown(KeyCode.LeftArrow) ||
                     bControllerLeft)
            {
                bControllerLeft = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    uMan.DecreaseOpacity();
                }
            }
            else if (Input.GetKeyDown(KeyCode.D) ||
                     Input.GetKeyDown(KeyCode.RightArrow) ||
                     bControllerRight)
            {
                bControllerRight = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    uMan.IncreaseOpacity();
                }
            }
            else if ((Input.GetButtonDown("Action") ||
                      contSupp.ControllerButtonPadBottom("down") ||
                      touches.bAaction))
            {
                if (currentPosition == SelectorPosition.showButtons)
                {
                    showButtonsToggle.isOn = !showButtonsToggle.isOn;
                    uMan.ToggleControls();
                    touches.Vibrate();
                }
                else if (currentPosition == SelectorPosition.dPad &&
                         !uMan.bOnlyDPad)
                {
                    dPadToggle.isOn = !dPadToggle.isOn;
                    uMan.ToggleDPadControl();
                    touches.Vibrate();
                }
                else if (currentPosition == SelectorPosition.vibrate)
                {
                    vibrateToggle.isOn = !vibrateToggle.isOn;
                    touches.ToggleVibrate();
                    touches.Vibrate();
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    ResetSelectors();
                    movePMA.bDelayAction = true;
                    pause.Controls(false);
                }

                touches.bAaction = false;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction") ||
                     touches.bBaction)
            {
                ResetSelectors();
            }

            if (contSupp.ControllerRightJoystickVertical() > 0)
            {
                if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMin.y < 0)
                {
                    controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3(
                        controlsMenu.GetChild(0).GetChild(0).localPosition.x,
                        controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        controlsMenu.GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMin = new Vector2(controlsMenu.GetChild(0).
                                            GetChild(0).GetComponent <RectTransform>().offsetMin.x,
                                            0);
                }
            }
            else if (contSupp.ControllerRightJoystickVertical() < 0)
            {
                if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMax.y * -1f < 0)
                {
                    controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3(
                        controlsMenu.GetChild(0).GetChild(0).localPosition.x,
                        controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        controlsMenu.GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMax = new Vector2(controlsMenu.GetChild(0).
                                            GetChild(0).GetComponent <RectTransform>().offsetMax.x,
                                            0);
                }
            }

            // Dev Support
            if (currentPosition == SelectorPosition.opacitySlider &&
                (Input.GetButton("Action") ||
                 contSupp.ControllerButtonPadBottom("hold") ||
                 (touches.bAvoidSubUIElements &&
                  touches.bUIactive)))
            {
                devSupportTimer -= 0.01f;

                if (devSupportTimer <= 0)
                {
                    bDevSupportActive = !bDevSupportActive;
                    ToggleDevSupport();
                }
            }
        }
    }
Ejemplo n.º 6
0
    void Update()
    {
        if ((Input.GetKeyDown(KeyCode.Escape) ||
             Input.GetKeyDown(KeyCode.P) ||
             contSupp.ControllerMenuRight("down")) &&
            !characterCanvas.activeSelf)
        {
            ToggleOptions();
        }

        if (characterCanvas.activeSelf)
        {
            // Controller Support
            if (!contSupp.bIsMoving)
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }
            //else if (!bFreezeControllerInput &&
            //         (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
            //          contSupp.ControllerLeftJoystickHorizontal() > 0))
            //{
            //    bControllerRight = true;
            //    bFreezeControllerInput = true;
            //}
            //else if (!bFreezeControllerInput &&
            //         (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
            //          contSupp.ControllerLeftJoystickHorizontal() < 0))
            //{
            //    bControllerLeft = true;
            //    bFreezeControllerInput = true;
            //}

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                if (currentPosition == SelectorPosition.jesus)
                {
                    currentPosition = SelectorPosition.modes;
                    backToModes.Select();
                }
                else if (currentPosition == SelectorPosition.modes)
                {
                    currentPosition = SelectorPosition.jesus;
                    characterButtons[0].Select();
                }
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                if (currentPosition == SelectorPosition.jesus)
                {
                    currentPosition = SelectorPosition.modes;
                    backToModes.Select();
                }
                else if (currentPosition == SelectorPosition.modes)
                {
                    currentPosition = SelectorPosition.jesus;
                    characterButtons[0].Select();
                }
            }

            //else if (Input.GetKeyDown(KeyCode.A) ||
            //         Input.GetKeyDown(KeyCode.LeftArrow) ||
            //         bControllerLeft)
            //{
            //    bControllerLeft = false;

            //    if (currentPosition == SelectorPosition.volume)
            //        vMan.LowerVolume();
            //    else if (currentPosition == SelectorPosition.music)
            //        vMan.LowerMusic();
            //}
            //else if (Input.GetKeyDown(KeyCode.D) ||
            //         Input.GetKeyDown(KeyCode.RightArrow) ||
            //         bControllerRight)
            //{
            //    bControllerRight = false;

            //    if (currentPosition == SelectorPosition.volume)
            //        vMan.RaiseVolume();
            //    else if (currentPosition == SelectorPosition.music)
            //        vMan.RaiseMusic();
            //}

            else if (Input.GetButtonDown("Action") ||
                     contSupp.ControllerButtonPadBottom("down"))
            {
                if (currentPosition == SelectorPosition.jesus)
                {
                    characterButtons[0].onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.modes)
                {
                    backToModes.onClick.Invoke();
                }
            }

            else if (contSupp.ControllerButtonPadRight("down"))
            {
                backToModes.onClick.Invoke();
                BackToArcade();
            }

            if (contSupp.ControllerRightJoystickVertical() > 0)
            {
                if (characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                    GetComponent <RectTransform>().offsetMin.y < 0)
                {
                    characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition = new Vector3(
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.x,
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                    GetComponent <RectTransform>().offsetMin = new Vector2(
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                        GetComponent <RectTransform>().offsetMin.x,
                        0);
                }
            }
            else if (contSupp.ControllerRightJoystickVertical() < 0)
            {
                if (characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                    GetComponent <RectTransform>().offsetMax.y * -1f < 0)
                {
                    characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition = new Vector3(
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.x,
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                    GetComponent <RectTransform>().offsetMax = new Vector2(
                        characterCanvas.transform.GetChild(1).GetChild(0).GetChild(0).
                        GetComponent <RectTransform>().offsetMax.x,
                        0);
                }
            }
        }
    }
    void Update()
    {
        // Quick skip on loading screens / scenes
        if (scene.name == "LogoSplash" &&
            (Input.anyKeyDown ||
             contSupp.ControllerButtonPadBottom("down") ||
             contSupp.ControllerButtonPadRight("down") ||
             contSupp.ControllerMenuRight("down")))
        {
            SceneManager.LoadScene(AlphaLoad);
        }

        if (scene.name == "SceneTransitioner")
        {
            if (!bLoadScene)
            {
                bLoadScene = true;

                switch (BetaLoad)
                {
                case "Chp0":
                    sceneTitle.text    = "Chapter 0";
                    sceneSubtitle.text = "Before the beginning...";
                    break;

                case "Chp1":
                    sceneTitle.text    = "Chapter 1";
                    sceneSubtitle.text = "In the beginning...";
                    break;

                case "CS_ShadowMonster":
                    sceneTitle.text    = "Be a Monster";
                    sceneSubtitle.text = "Akira's Shadow";
                    break;

                case "CS_TreeTunnel":
                    sceneTitle.text    = "A Great Tree";
                    sceneSubtitle.text = "Offering you a branch..";
                    break;

                case "CS_TyrannyTunnel":
                    sceneTitle.text    = "I'm So Tired";
                    sceneSubtitle.text = "/u/SnowflakeSorcerer & @TheBirminghamBear";
                    break;

                case "CS_Wealthy":
                    sceneTitle.text    = "Be Wealthy";
                    sceneSubtitle.text = "Akira's How To";
                    break;

                case "Minesweeper":
                    sceneTitle.text    = "Minesweeper";
                    sceneSubtitle.text = "Boom baby...";
                    break;

                case "GuessWhoColluded":
                    sceneTitle.text    = "Guess Who";
                    sceneSubtitle.text = "Colluded...";
                    break;

                case "PookieVision":
                    sceneTitle.text    = "Pookie Vision";
                    sceneSubtitle.text = "For the kids..";
                    break;

                case "TD_Menu":
                    sceneTitle.text    = "TowerDeez";
                    sceneSubtitle.text = "And it's nuts..";
                    break;

                case "TD_SBF_Menu":
                    sceneTitle.text    = "Super Best Friends TD";
                    sceneSubtitle.text = "Hoooooooooooo..";
                    break;

                default:
                    sceneTitle.text    = "n_n";
                    sceneSubtitle.text = "Loading some scene...";
                    break;
                }

                StartCoroutine(LoadNewScene());
            }

            if (bLoadScene)
            {
                // Animation
                //sceneSubtitle.color = new Color(sceneSubtitle.color.r, sceneSubtitle.color.g, sceneSubtitle.color.b, Mathf.PingPong(Time.time, 1));
            }
        }
    }
    void Update()
    {
        if (stuffMenu.localScale == Vector3.one &&
            itemMenu.GetComponent <CanvasGroup>().alpha == 0)
        {
            // Controller Support
            if (bDelayAction)
            {
                bDelayAction = false;
                return;
            }

            // Controller Support
            if (!contSupp.bIsMoving &&
                fixedJoystick.Vertical == 0 &&
                fixedJoystick.Horizontal == 0 &&
                (!touches.bDown &&
                 !touches.bUp &&
                 !touches.bLeft &&
                 !touches.bRight))
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0 ||
                      touches.bDown ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical < 0)))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0 ||
                      touches.bUp ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical > 0)))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() > 0 ||
                      fixedJoystick.Horizontal > 0 ||
                      touches.bRight))
            {
                bControllerRight       = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() < 0 ||
                      fixedJoystick.Horizontal < 0 ||
                      touches.bLeft))
            {
                bControllerLeft        = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                if (currentPosition == SelectorPosition.item1)
                {
                    currentPosition = SelectorPosition.item6;
                    ClearAllSelectors();
                    itemSelector6.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item2)
                {
                    currentPosition = SelectorPosition.item7;
                    ClearAllSelectors();
                    itemSelector7.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item3)
                {
                    currentPosition = SelectorPosition.item8;
                    ClearAllSelectors();
                    itemSelector8.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item4)
                {
                    currentPosition = SelectorPosition.item9;
                    ClearAllSelectors();
                    itemSelector9.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item5)
                {
                    currentPosition = SelectorPosition.item10;
                    ClearAllSelectors();
                    itemSelector10.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item6)
                {
                    currentPosition = SelectorPosition.item11;
                    ClearAllSelectors();
                    itemSelector11.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item7)
                {
                    currentPosition = SelectorPosition.item12;
                    ClearAllSelectors();
                    itemSelector12.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item8)
                {
                    currentPosition = SelectorPosition.item13;
                    ClearAllSelectors();
                    itemSelector13.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item9)
                {
                    currentPosition = SelectorPosition.item14;
                    ClearAllSelectors();
                    itemSelector14.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item10)
                {
                    currentPosition = SelectorPosition.item15;
                    ClearAllSelectors();
                    itemSelector15.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item11)
                {
                    currentPosition = SelectorPosition.item16;
                    ClearAllSelectors();
                    itemSelector16.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item12)
                {
                    currentPosition = SelectorPosition.item17;
                    ClearAllSelectors();
                    itemSelector17.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item13)
                {
                    currentPosition = SelectorPosition.item18;
                    ClearAllSelectors();
                    itemSelector18.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item14)
                {
                    currentPosition = SelectorPosition.item19;
                    ClearAllSelectors();
                    itemSelector19.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item15)
                {
                    currentPosition = SelectorPosition.item20;
                    ClearAllSelectors();
                    itemSelector20.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item16)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item17)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item18)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item19)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item20)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    if (selectorColumn == 1)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item1;
                        itemSelector1.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 2)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item2;
                        itemSelector2.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 3)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item3;
                        itemSelector3.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 4)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item4;
                        itemSelector4.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 5)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item5;
                        itemSelector5.transform.localScale = Vector3.one;
                    }
                }
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                if (currentPosition == SelectorPosition.item1)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item2)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item3)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item4)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item5)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }


                else if (currentPosition == SelectorPosition.item6)
                {
                    currentPosition = SelectorPosition.item1;
                    ClearAllSelectors();
                    itemSelector1.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item7)
                {
                    currentPosition = SelectorPosition.item2;
                    ClearAllSelectors();
                    itemSelector2.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item8)
                {
                    currentPosition = SelectorPosition.item3;
                    ClearAllSelectors();
                    itemSelector3.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item9)
                {
                    currentPosition = SelectorPosition.item4;
                    ClearAllSelectors();
                    itemSelector4.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item10)
                {
                    currentPosition = SelectorPosition.item5;
                    ClearAllSelectors();
                    itemSelector5.transform.localScale = Vector3.one;
                }


                else if (currentPosition == SelectorPosition.item11)
                {
                    currentPosition = SelectorPosition.item6;
                    ClearAllSelectors();
                    itemSelector6.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item12)
                {
                    currentPosition = SelectorPosition.item7;
                    ClearAllSelectors();
                    itemSelector7.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item13)
                {
                    currentPosition = SelectorPosition.item8;
                    ClearAllSelectors();
                    itemSelector8.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item14)
                {
                    currentPosition = SelectorPosition.item9;
                    ClearAllSelectors();
                    itemSelector9.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item15)
                {
                    currentPosition = SelectorPosition.item10;
                    ClearAllSelectors();
                    itemSelector10.transform.localScale = Vector3.one;
                }


                else if (currentPosition == SelectorPosition.item16)
                {
                    currentPosition = SelectorPosition.item11;
                    ClearAllSelectors();
                    itemSelector11.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item17)
                {
                    currentPosition = SelectorPosition.item12;
                    ClearAllSelectors();
                    itemSelector12.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item18)
                {
                    currentPosition = SelectorPosition.item13;
                    ClearAllSelectors();
                    itemSelector13.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item19)
                {
                    currentPosition = SelectorPosition.item14;
                    ClearAllSelectors();
                    itemSelector14.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item20)
                {
                    currentPosition = SelectorPosition.item15;
                    ClearAllSelectors();
                    itemSelector15.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    if (selectorColumn == 1)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item16;
                        itemSelector16.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 2)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item17;
                        itemSelector17.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 3)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item18;
                        itemSelector18.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 4)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item19;
                        itemSelector19.transform.localScale = Vector3.one;
                    }
                    else if (selectorColumn == 5)
                    {
                        backSelector.transform.localScale = Vector3.zero;
                        currentPosition = SelectorPosition.item20;
                        itemSelector20.transform.localScale = Vector3.one;
                    }
                }
            }
            else if (Input.GetKeyDown(KeyCode.A) ||
                     Input.GetKeyDown(KeyCode.LeftArrow) ||
                     bControllerLeft)
            {
                bControllerLeft = false;

                if (currentPosition == SelectorPosition.item1)
                {
                    currentPosition = SelectorPosition.item5;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector5.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item2)
                {
                    currentPosition = SelectorPosition.item1;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector1.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item3)
                {
                    currentPosition = SelectorPosition.item2;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector2.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item4)
                {
                    currentPosition = SelectorPosition.item3;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector3.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item5)
                {
                    currentPosition = SelectorPosition.item4;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector4.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item6)
                {
                    currentPosition = SelectorPosition.item10;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector10.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item7)
                {
                    currentPosition = SelectorPosition.item6;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector6.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item8)
                {
                    currentPosition = SelectorPosition.item7;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector7.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item9)
                {
                    currentPosition = SelectorPosition.item8;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector8.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item10)
                {
                    currentPosition = SelectorPosition.item9;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector9.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item11)
                {
                    currentPosition = SelectorPosition.item15;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector15.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item12)
                {
                    currentPosition = SelectorPosition.item11;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector11.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item13)
                {
                    currentPosition = SelectorPosition.item12;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector12.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item14)
                {
                    currentPosition = SelectorPosition.item13;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector13.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item15)
                {
                    currentPosition = SelectorPosition.item14;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector14.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item16)
                {
                    currentPosition = SelectorPosition.item20;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector20.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item17)
                {
                    currentPosition = SelectorPosition.item16;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector16.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item18)
                {
                    currentPosition = SelectorPosition.item17;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector17.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item19)
                {
                    currentPosition = SelectorPosition.item18;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector18.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item20)
                {
                    currentPosition = SelectorPosition.item19;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector19.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    if (selectorColumn == 1)
                    {
                        selectorColumn = 5;
                    }
                    else if (selectorColumn == 2)
                    {
                        selectorColumn = 1;
                    }
                    else if (selectorColumn == 3)
                    {
                        selectorColumn = 2;
                    }
                    else if (selectorColumn == 4)
                    {
                        selectorColumn = 3;
                    }
                    else if (selectorColumn == 5)
                    {
                        selectorColumn = 4;
                    }
                }
            }
            else if (Input.GetKeyDown(KeyCode.D) ||
                     Input.GetKeyDown(KeyCode.RightArrow) ||
                     bControllerRight)
            {
                bControllerRight = false;

                if (currentPosition == SelectorPosition.item1)
                {
                    currentPosition = SelectorPosition.item2;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector2.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item2)
                {
                    currentPosition = SelectorPosition.item3;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector3.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item3)
                {
                    currentPosition = SelectorPosition.item4;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector4.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item4)
                {
                    currentPosition = SelectorPosition.item5;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector5.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item5)
                {
                    currentPosition = SelectorPosition.item1;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector1.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item6)
                {
                    currentPosition = SelectorPosition.item7;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector7.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item7)
                {
                    currentPosition = SelectorPosition.item8;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector8.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item8)
                {
                    currentPosition = SelectorPosition.item9;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector9.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item9)
                {
                    currentPosition = SelectorPosition.item10;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector10.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item10)
                {
                    currentPosition = SelectorPosition.item6;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector6.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item11)
                {
                    currentPosition = SelectorPosition.item12;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector12.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item12)
                {
                    currentPosition = SelectorPosition.item13;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector13.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item13)
                {
                    currentPosition = SelectorPosition.item14;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector14.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item14)
                {
                    currentPosition = SelectorPosition.item15;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector15.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item15)
                {
                    currentPosition = SelectorPosition.item11;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector11.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item16)
                {
                    currentPosition = SelectorPosition.item17;
                    selectorColumn  = 2;
                    ClearAllSelectors();
                    itemSelector17.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item17)
                {
                    currentPosition = SelectorPosition.item18;
                    selectorColumn  = 3;
                    ClearAllSelectors();
                    itemSelector18.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item18)
                {
                    currentPosition = SelectorPosition.item19;
                    selectorColumn  = 4;
                    ClearAllSelectors();
                    itemSelector19.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item19)
                {
                    currentPosition = SelectorPosition.item20;
                    selectorColumn  = 5;
                    ClearAllSelectors();
                    itemSelector20.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.item20)
                {
                    currentPosition = SelectorPosition.item16;
                    selectorColumn  = 1;
                    ClearAllSelectors();
                    itemSelector16.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    if (selectorColumn == 1)
                    {
                        selectorColumn = 2;
                    }
                    else if (selectorColumn == 2)
                    {
                        selectorColumn = 3;
                    }
                    else if (selectorColumn == 3)
                    {
                        selectorColumn = 4;
                    }
                    else if (selectorColumn == 4)
                    {
                        selectorColumn = 5;
                    }
                    else if (selectorColumn == 5)
                    {
                        selectorColumn = 1;
                    }
                }
            }
            else if (bAllowSelection &&
                     (Input.GetButtonDown("Action") ||
                      contSupp.ControllerButtonPadBottom("down") ||
                      touches.bAaction))
            {
                if (currentPosition == SelectorPosition.item1)
                {
                    item1.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item2)
                {
                    item2.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item3)
                {
                    item3.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item4)
                {
                    item4.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item5)
                {
                    item5.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item6)
                {
                    item6.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item7)
                {
                    item7.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item8)
                {
                    item8.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item9)
                {
                    item9.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item10)
                {
                    item10.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item11)
                {
                    item11.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item12)
                {
                    item12.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item13)
                {
                    item13.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item14)
                {
                    item14.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item15)
                {
                    item15.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item16)
                {
                    item16.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item17)
                {
                    item17.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item18)
                {
                    item18.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item19)
                {
                    item19.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.item20)
                {
                    item20.onClick.Invoke();
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    ResetSelectors();
                    movePMA.bDelayAction = true;
                    bDelayAction         = true;
                    pause.Stuff(false);
                }

                touches.bAaction = false;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction") ||
                     touches.bBaction)
            {
                ResetSelectors();
            }

            if (!bAvoidAllower)
            {
                bAvoidAllower   = true;
                bAllowSelection = true;
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (controlsMenu.localScale == Vector3.one)
        {
            // Controller Support
            if (!contSupp.bIsMoving &&
                fixedJoystickLeft.Vertical == 0 &&
                fixedJoystickLeft.Horizontal == 0)
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0 ||
                      (Mathf.Abs(fixedJoystickLeft.Vertical) > Mathf.Abs(fixedJoystickLeft.Horizontal) &&
                       fixedJoystickLeft.Vertical < 0)))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0 ||
                      (Mathf.Abs(fixedJoystickRight.Vertical) > Mathf.Abs(fixedJoystickRight.Horizontal) &&
                       fixedJoystickRight.Vertical > 0)))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() > 0 ||
                      fixedJoystickLeft.Horizontal > 0))
            {
                bControllerRight       = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() < 0 ||
                      fixedJoystickLeft.Horizontal < 0))
            {
                bControllerLeft        = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    currentPosition = SelectorPosition.vibrate;
                    ClearAllSelectors();
                    vibrateSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.vibrate)
                {
                    currentPosition = SelectorPosition.description;
                    ClearAllSelectors();
                    controlsDescriptionSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.description)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.opacitySlider;
                    ClearAllSelectors();
                    buttonOpacitySelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.vibrate)
                {
                    currentPosition = SelectorPosition.opacitySlider;
                    ClearAllSelectors();
                    buttonOpacitySelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.description)
                {
                    currentPosition = SelectorPosition.vibrate;
                    ClearAllSelectors();
                    vibrateSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.description;
                    ClearAllSelectors();
                    controlsDescriptionSelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.A) ||
                     Input.GetKeyDown(KeyCode.LeftArrow) ||
                     bControllerLeft)
            {
                bControllerLeft = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    touches.DecreaseOpacity();
                }
            }
            else if (Input.GetKeyDown(KeyCode.D) ||
                     Input.GetKeyDown(KeyCode.RightArrow) ||
                     bControllerRight)
            {
                bControllerRight = false;

                if (currentPosition == SelectorPosition.opacitySlider)
                {
                    touches.IncreaseOpacity();
                }
            }
            else if (Input.GetButtonDown("Action") ||
                     contSupp.ControllerButtonPadBottom("down"))
            {
                if (currentPosition == SelectorPosition.vibrate)
                {
                    vibrateToggle.isOn = !vibrateToggle.isOn;
                    touches.ToggleVibrate();
                    touches.Vibrate();
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    ResetSelectors();
                    //movePMA.bDelayAction = true; // DC TODO
                    pause.ToggleControls();
                }
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction"))
            {
                ResetSelectors();
            }

            if (contSupp.ControllerRightJoystickVertical() > 0)
            {
                if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMin.y < 0)
                {
                    controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3(
                        controlsMenu.GetChild(0).GetChild(0).localPosition.x,
                        controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        controlsMenu.GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMin = new Vector2(controlsMenu.GetChild(0).
                                            GetChild(0).GetComponent <RectTransform>().offsetMin.x,
                                            0);
                }
            }
            else if (contSupp.ControllerRightJoystickVertical() < 0)
            {
                if (controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMax.y * -1f < 0)
                {
                    controlsMenu.GetChild(0).GetChild(0).localPosition = new Vector3(
                        controlsMenu.GetChild(0).GetChild(0).localPosition.x,
                        controlsMenu.GetChild(0).GetChild(0).localPosition.y + 10 * contSupp.ControllerRightJoystickVertical(),
                        controlsMenu.GetChild(0).GetChild(0).localPosition.z);
                }
                else
                {
                    controlsMenu.GetChild(0).GetChild(0).GetComponent <RectTransform>().
                    offsetMax = new Vector2(controlsMenu.GetChild(0).
                                            GetChild(0).GetComponent <RectTransform>().offsetMax.x,
                                            0);
                }
            }
        }
    }
    void Update()
    {
        if (soundMenu.localScale == Vector3.one)
        {
            // Controller Support
            if (!contSupp.bIsMoving &&
                fixedJoystick.Vertical == 0 &&
                fixedJoystick.Horizontal == 0 &&
                (!touches.bDown &&
                 !touches.bUp &&
                 !touches.bLeft &&
                 !touches.bRight))
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() < 0 ||
                      contSupp.ControllerLeftJoystickVertical() < 0 ||
                      touches.bDown ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical < 0)))
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadVertical() > 0 ||
                      contSupp.ControllerLeftJoystickVertical() > 0 ||
                      touches.bUp ||
                      (Mathf.Abs(fixedJoystick.Vertical) > Mathf.Abs(fixedJoystick.Horizontal) &&
                       fixedJoystick.Vertical > 0)))
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() > 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() > 0 ||
                      fixedJoystick.Horizontal > 0 ||
                      touches.bRight))
            {
                bControllerRight       = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     (contSupp.ControllerDirectionalPadHorizontal() < 0 ||
                      contSupp.ControllerLeftJoystickHorizontal() < 0 ||
                      fixedJoystick.Horizontal < 0 ||
                      touches.bLeft))
            {
                bControllerLeft        = true;
                bFreezeControllerInput = true;
            }

            if (Input.GetKeyDown(KeyCode.S) ||
                Input.GetKeyDown(KeyCode.DownArrow) ||
                bControllerDown)
            {
                bControllerDown = false;

                if (currentPosition == SelectorPosition.volumeSlider)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.volumeSlider;
                    ClearAllSelectors();
                    volumeSelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.W) ||
                     Input.GetKeyDown(KeyCode.UpArrow) ||
                     bControllerUp)
            {
                bControllerUp = false;

                if (currentPosition == SelectorPosition.volumeSlider)
                {
                    currentPosition = SelectorPosition.back;
                    ClearAllSelectors();
                    backSelector.transform.localScale = Vector3.one;
                }
                else if (currentPosition == SelectorPosition.back)
                {
                    currentPosition = SelectorPosition.volumeSlider;
                    ClearAllSelectors();
                    volumeSelector.transform.localScale = Vector3.one;
                }
            }
            else if (Input.GetKeyDown(KeyCode.A) ||
                     Input.GetKeyDown(KeyCode.LeftArrow) ||
                     bControllerLeft)
            {
                bControllerLeft = false;

                if (currentPosition == SelectorPosition.volumeSlider)
                {
                    vMan.LowerVolume();
                }
            }
            else if (Input.GetKeyDown(KeyCode.D) ||
                     Input.GetKeyDown(KeyCode.RightArrow) ||
                     bControllerRight)
            {
                bControllerRight = false;

                if (currentPosition == SelectorPosition.volumeSlider)
                {
                    vMan.RaiseVolume();
                }
            }
            else if ((Input.GetButtonDown("Action") ||
                      contSupp.ControllerButtonPadBottom("down") ||
                      touches.bAaction))
            {
                if (currentPosition == SelectorPosition.back)
                {
                    ResetSelectors();
                    movePMA.bDelayAction = true;
                    pause.Sound(false);
                }

                touches.bAaction = false;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) ||
                     contSupp.ControllerMenuRight("down") ||
                     contSupp.ControllerButtonPadRight("down") ||
                     Input.GetButton("BAction") ||
                     touches.bBaction)
            {
                ResetSelectors();
            }
        }
    }