예제 #1
0
 public Vector2 GetStickVector(XboxControlStick stick)
 {
     GamePadThumbSticks.StickValue stickValue = XboxControlSticktoStickValue(gamePadState, stick);
     return(new Vector2(stickValue.X, stickValue.Y).normalized);
 }
예제 #2
0
    static GamePadThumbSticks.StickValue XboxControlSticktoStickValue(GamePadState state, XboxControlStick stick)
    {
        switch (stick)
        {
        case XboxControlStick.LeftStick:
            return(state.ThumbSticks.Left);

        case XboxControlStick.RightStick:
            return(state.ThumbSticks.Right);
        }
        return(new GamePadThumbSticks.StickValue());
    }