public static void WriteValueIntoEvent <TValue>(this InputControl control, TValue value, InputEventPtr eventPtr) where TValue : struct { if (control == null) { throw new ArgumentNullException(nameof(control)); } if (!eventPtr.valid) { throw new ArgumentNullException(nameof(eventPtr)); } if (!(control is InputControl <TValue> controlOfType)) { throw new ArgumentException( $"Expecting control of type '{typeof(TValue).Name}' but got '{control.GetType().Name}'"); } controlOfType.WriteValueIntoEvent(value, eventPtr); }
public static unsafe void WriteValueIntoState <TValue>(this InputControl control, TValue value, void *statePtr) where TValue : struct { if (control == null) { throw new ArgumentNullException(nameof(control)); } if (!(control is InputControl <TValue> controlOfType)) { throw new ArgumentException( $"Expecting control of type '{typeof(TValue).Name}' but got '{control.GetType().Name}'"); } controlOfType.WriteValueIntoState(value, statePtr); }