public Vector2 GetStickVector(XboxControlStick stick) { GamePadThumbSticks.StickValue stickValue = XboxControlSticktoStickValue(gamePadState, stick); return(new Vector2(stickValue.X, stickValue.Y).normalized); }
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()); }