Exemplo n.º 1
0
    void Update()
    {
        if (contSupp.bControllerConnected &&
            buildDescBar.activeSelf &&
            nodeUI.selectionEffect &&
            !bReturnIsSelected)
        {
            returnB.Select();

            bReturnIsSelected = true;

            StartCoroutine(contSupp.BelayAction());
        }

        if (contSupp.bControllerConnected &&
            !contSupp.bBelayAction &&
            buildDescBar.activeSelf &&
            bIsNowBuildDescMode)
        {
            if (contSupp.ControllerButtonPadBottom("down") ||
                contSupp.ControllerButtonPadRight("down"))
            {
                SelectOption();
            }
        }
    }
    void Update()
    {
        if (contSupp.bControllerConnected &&
            upgradeShell.activeSelf &&
            !bIsNowNodeUIMode &&
            !buildDescBarSel.bIsNowBuildDescMode)
        {
            upgradeB.Select();
            bIsNowNodeUIMode = true;
            currentSelection = NodeUISelection.Upgrade;

            cMan.OnTUB();
            cMan.RestoreTUBInteractability();

            contSupp.bBelayAction = true;
        }

        if (contSupp.bControllerConnected &&
            bIsNowNodeUIMode &&
            upgradeShell.activeSelf)
        {
            // Controller Support
            if (contSupp.ControllerRightJoystickVertical() == 0)
            {
                bFreezeControllerInput = false;
            }
            else if (!bFreezeControllerInput &&
                     contSupp.ControllerRightJoystickVertical() > 0)
            {
                bControllerDown        = true;
                bFreezeControllerInput = true;
            }
            else if (!bFreezeControllerInput &&
                     contSupp.ControllerRightJoystickVertical() < 0)
            {
                bControllerUp          = true;
                bFreezeControllerInput = true;
            }

            if (bControllerDown)
            {
                bControllerDown = false;
                MoveDown();
            }
            else if (bControllerUp)
            {
                bControllerUp = false;
                MoveUp();
            }
            else if (contSupp.ControllerButtonPadBottom("down"))
            {
                SelectOption();
            }
            else if (contSupp.ControllerButtonPadRight("down"))
            {
                StartCoroutine(contSupp.BelayAction());

                ResetNodeUI();
                shopSel.ResetTowerMode();
            }
            else if (contSupp.ControllerBumperRight("down") ||
                     contSupp.ControllerBumperLeft("down"))
            {
                shopSel.ResetScroll();
            }
        }
    }