| 1666 | return *(_T *)unboxed; |
| 1667 | } |
| 1668 | } |
| 1669 | |
| 1670 | return |
| 1671 | std::nullopt; |
| 1672 | } |
| 1673 | |
| 1674 | void |
| 1675 | SK_Unity_SetInputPollingFreq (float PollingHz) |
| 1676 | { |
| 1677 | #ifdef HAVE_WORKING_INPUT_POLLING_FREQ |
| 1678 | if (std::exchange (SK_Unity_InputPollingFrequency, PollingHz) == PollingHz) |
| 1679 | return; |
| 1680 | |
| 1681 | AttachThread (); |
| 1682 | |
| 1683 | auto NativeInputRuntime_instance = |
| 1684 | GetStaticFieldValue ("NativeInputRuntime", "instance", "Unity.InputSystem", "UnityEngine.InputSystem.LowLevel"); |
| 1685 | |
| 1686 | if (NativeInputRuntime_instance != nullptr) |
| 1687 | { |
| 1688 | void* params [1] = { &PollingHz }; |
| 1689 | |
| 1690 | SK_LOGi0 (L"Setting Input Polling Hz: %f", PollingHz); |
| 1691 | |
| 1692 | InvokeMethod ("UnityEngine.InputSystem.LowLevel", "NativeInputRuntime", "set_pollingFrequency", 1, NativeInputRuntime_instance, "Unity.InputSystem", params); |
| 1693 | } |
| 1694 | |
| 1695 | // We don't want garbage collection overhead on this thread just because we called a function once! |
| 1696 | DetachCurrentThreadIfNotNative (); |
| 1697 | #else |
no test coverage detected