Exemple #1
0
    void Move()
    {
        float horizontalAxis = Input.GetAxisRaw(_horizontalAxisName);
        float verticalAxis   = Input.GetAxisRaw(_verticalAxisName);

        if (horizontalAxis > 0.2f)
        {
            characterSelect.MoveRight(player);
            StartCoroutine(BlockInput());
        }
        else if (horizontalAxis < -0.2f)
        {
            characterSelect.MoveLeft(player);
            StartCoroutine(BlockInput());
        }
        else if (verticalAxis > 0.2f)
        {
            characterSelect.MoveUp(player);
            StartCoroutine(BlockInput());
        }
        else if (verticalAxis < -0.2f)
        {
            characterSelect.MoveDown(player);
            StartCoroutine(BlockInput());
        }
    }