Unity-DirectInput
Unity-DirectInput copied to clipboard
how to support the IL2cpp
build with IL2cpp,find not working use this Library
Just commenting here in case anyone else runs into this problem, the solution is fairly easy
In DirectInputManager.cs simply add these two lines above the OnDeviceChange function then it will work perfectly in il2cpp builds! It just needs a MonoPInvokeCallback and a delegate for that callback. Not entirely sure why but it works
public delegate void deviceChange(DBTEvents DBTEvent); [MonoPInvokeCallback(typeof(DIManager.deviceChange))] private static void OnDeviceChange(DBTEvents DBTEvent) { ODCDebouncer.Debounce(() => { ScanDevicesForChanges(); }); }