public void Events_CanSendLargerStateToDeviceWithSmallerState()
    {
        var device = InputSystem.AddDevice <CustomDevice>();

        var state = new ExtendedCustomDeviceState {
            baseState = { axis = 0.5f }
        };

        InputSystem.QueueStateEvent(device, state);
        InputSystem.Update();

        Assert.That(device.axis.ReadValue(), Is.EqualTo(0.5).Within(0.000001));
    }
Exemple #2
0
    public void Events_CandSendLargerStateToDeviceWithSmallerState()
    {
        InputSystem.RegisterControlLayout <CustomDevice>();
        var device = (CustomDevice)InputSystem.AddDevice("CustomDevice");

        var state = new ExtendedCustomDeviceState();

        state.baseState.axis = 0.5f;
        InputSystem.QueueStateEvent(device, state);
        InputSystem.Update();

        Assert.That(device.axis.ReadValue(), Is.EqualTo(0.5).Within(0.000001));
    }