SteamVR_Action_Vector2.ChangeHandler CreateDoubleAxisHandler(DoubleAxis doubleAxis, SingleAxis singleX, SingleAxis singleY) { return((SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 axis, Vector2 delta) => { var x = Mathf.Round(axis.x * 100) / 100; var y = Mathf.Round(axis.y * 100) / 100; _doubleAxes[doubleAxis] = new Vector2(x, y); _singleAxes[singleX.GetInputAxisName(0)] = x; _singleAxes[singleY.GetInputAxisName(0)] = y; }); }
SteamVR_Action_Single.ChangeHandler CreateSingleAxisHandler(SingleAxis singleAxis, int axisDirection) { return((SteamVR_Action_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta) => { _singleAxes[singleAxis.GetInputAxisName(0)] = axisDirection * Mathf.Round(newAxis * 10) / 10; }); }
SteamVR_Action_Boolean.ChangeHandler CreateButtonHandler(SingleAxis singleAxis, int axisDirection) { return((SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState) => { _singleAxes[singleAxis.GetInputAxisName(0)] = axisDirection * (newState ? 1 : 0); }); }
public static void SimulateInput(SingleAxis axis, float value) { _singleAxes[axis.GetInputAxisName(0)] = value; }