Esempio n. 1
0
    void Update()
    {
        if (Input.GetAxisRaw(horizontalAxis) == 0)
        {
            axisHeld = false;
        }

        // Select Stage
        if (!axisHeld && UFE.config.selectedStage == null)
        {
            hoverIndex = StageSelect(hoverIndex);

            if (Input.GetButtonDown(UFE.GetInputReference(selectButton, UFE.config.player1_Inputs)) ||
                Input.GetKeyDown(KeyCode.Space) ||
                Input.GetKeyDown(KeyCode.Return))
            {
                UFE.config.selectedStage = UFE.config.stages[hoverIndex];
                if (UFE.config.soundfx)
                {
                    Camera.main.audio.PlayOneShot(selectSound);
                }
                Invoke("StartGame", 1.2f);
                startingGame = true;
            }
        }

        if (Input.GetAxisRaw(horizontalAxis) != 0)
        {
            axisHeld = true;
        }
    }
Esempio n. 2
0
    void Start()
    {
        GUITexture[] guiTextures = GetComponentsInChildren <GUITexture>();
        foreach (GUITexture guiTexChild in guiTextures)
        {
            guiTexChild.pixelInset = SetResolution(guiTexChild.pixelInset);
        }

        UFE.config.selectedStage = null;
        horizontalAxis           = UFE.GetInputReference(InputType.HorizontalAxis, UFE.config.player1_Inputs);

        returnButtonRect = new Rect(10, 10, returnButtonStyle.normal.background.width, returnButtonStyle.normal.background.height);
        returnButtonRect = SetResolution(returnButtonRect);
    }
    void Update()
    {
        if (Input.GetAxisRaw(p1HorizontalAxis) == 0 && Input.GetAxisRaw(p1VerticalAxis) == 0)
        {
            p1AxisHeld = false;
        }
        if (Input.GetAxisRaw(p2HorizontalAxis) == 0 && Input.GetAxisRaw(p2VerticalAxis) == 0)
        {
            p2AxisHeld = false;
        }

        // Select Character
        if (!p1AxisHeld && UFE.config.player1Character == null)
        {
            p1HoverIndex = CharacterMenuSelection(p1HoverIndex, p1HorizontalAxis, p1VerticalAxis);

            if (Input.GetButtonDown(UFE.GetInputReference(selectButton, UFE.config.player1_Inputs)))
            {
                if (UFE.config.soundfx)
                {
                    Camera.main.audio.PlayOneShot(selectSound);
                }
                UFE.config.player1Character = UFE.config.characters[p1HoverIndex];
            }
        }

        if (!p2AxisHeld && UFE.config.player2Character == null)
        {
            p2HoverIndex = CharacterMenuSelection(p2HoverIndex, p2HorizontalAxis, p2VerticalAxis);

            //Debug.Log(selectButton.ToString() +" = "+ Input.GetButtonDown(UFE.GetInputReference(selectButton, UFE.config.player2_Inputs)));
            if (Input.GetButtonDown(UFE.GetInputReference(selectButton, UFE.config.player2_Inputs)))
            {
                if (UFE.config.soundfx)
                {
                    Camera.main.audio.PlayOneShot(selectSound);
                }
                UFE.config.player2Character = UFE.config.characters[p2HoverIndex];
            }
        }



        // Both selected
        if (UFE.config.player1Character != null && UFE.config.player2Character != null)
        {
            startingStageSelect = true;
            Invoke("StartStageSelect", .8f);
        }


        // Deselect Character
        if (!startingStageSelect && Input.GetButtonDown(UFE.GetInputReference(deselectButton, UFE.config.player1_Inputs)))
        {
            UFE.config.player1Character = null;
        }

        if (!startingStageSelect && Input.GetButtonDown(UFE.GetInputReference(deselectButton, UFE.config.player2_Inputs)))
        {
            UFE.config.player2Character = null;
        }


        if (Input.GetAxisRaw(p1HorizontalAxis) != 0 || Input.GetAxisRaw(p1VerticalAxis) != 0)
        {
            p1AxisHeld = true;
        }
        if (Input.GetAxisRaw(p2HorizontalAxis) != 0 || Input.GetAxisRaw(p2VerticalAxis) != 0)
        {
            p2AxisHeld = true;
        }
    }