private void UpdateInputDevice() { bool anyJoystickKey = false; if (_inputDevice == InputDevice.Joystick) { if (InputManager.anyKey) { for (int i = 0; i <= 19; i++) { if (InputManager.GetKey((KeyCode)(_firstJoystickKey + i))) { anyJoystickKey = true; break; } } if (!anyJoystickKey) { SetInputDevice(InputDevice.KeyboardAndMouse); } } else { if (InputManager.AnyInput(_keyboardConfiguration)) { SetInputDevice(InputDevice.KeyboardAndMouse); } } } else { if (InputManager.anyKey) { for (int i = 0; i <= 19; i++) { if (InputManager.GetKey((KeyCode)(_firstJoystickKey + i))) { anyJoystickKey = true; break; } } if (anyJoystickKey) { SetInputDevice(InputDevice.Joystick); } } else { if (InputManager.AnyInput(_joystickConfiguration)) { SetInputDevice(InputDevice.Joystick); } } } }