public void ResetPlayerInput(PlayerInput input) { // Change the mock input device back to what it was originally ReadOnlyArray <InputDevice> devices = InputSystem.devices; InputDevice deviceToRemove = null; foreach (InputDevice d in devices) { if (d.deviceId == mockDeviceId) { deviceToRemove = d; } } InputDevice[] originalDevices = InputSystem.devices.Where(e => DeviceIds.Contains(e.deviceId)).ToArray(); input.SwitchCurrentControlScheme(ControlScheme, originalDevices); // Remove the mock input device from the input system InputSystem.RemoveDevice(deviceToRemove); }