Exemple #1
0
    private void handleInput()
    {
        _inputAngle = Vector2.Angle(Vector2.up, _stickLocation);

        // up
        if (_inputAngle < 45.0f)
        {
            ControllerMap.SearchForUp();
        }
        // left and right
        else if (_inputAngle > 45.0f && _inputAngle < 135.0f)
        {
            // left
            if (_stickLocation.x > 0)
            {
                ControllerMap.SearchForLeft();
            }
            // right
            else
            {
                ControllerMap.SearchForRight();
            }
        }
        // down
        else
        {
            ControllerMap.SearchForDown();
        }
    }