Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed an issue with default device selection when adding new Control Scheme.
- Fixed an issue where action map delegates were not updated when the asset already assigned to the PlayerInput component were changed [ISXB-711](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-711).
- Fixed Action properties edition in the UI Toolkit version of the Input Actions Asset editor. [ISXB-1277](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1277)
- Fixed an editor crash caused by input debugger device state window reusing cached state when reconnecting Stadia controller. [ISXB-658](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-658)

### Changed
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@ public unsafe void InitializeWithControl(InputControl control)
PollBuffersFromControl(control, selectBuffer: true);

titleContent = new GUIContent(control.displayName);

InputSystem.onDeviceChange += OnDeviceChange;
}

private void OnDeviceChange(InputDevice device, InputDeviceChange change)
{
if (m_Control is null)
return;

if (device.deviceId != m_Control.device.deviceId)
return;

if (change == InputDeviceChange.Removed)
Close();
}

internal void OnDestroy()
{
if (m_Control != null)
InputSystem.onDeviceChange -= OnDeviceChange;
}

private unsafe void PollBuffersFromControl(InputControl control, bool selectBuffer = false)
Expand Down Expand Up @@ -286,6 +306,12 @@ private string FormatByte(byte value)
////TODO: support dumping multiple state side-by-side when comparing
private void DrawHexDump()
{
if (m_StateBuffers is null)
return;

if (m_StateBuffers[m_SelectedStateBuffer] is null)
return;

m_HexDumpScrollPosition = EditorGUILayout.BeginScrollView(m_HexDumpScrollPosition);

var stateBuffer = m_StateBuffers[m_SelectedStateBuffer];
Expand Down
Loading