diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index dfe4b43bbd..5a26fbbc3f 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the Input Debugger window (Window > Analysis > Input Debugger) being resizable arbitrarily small until its toolbar and device/action/layout tree view were no longer usably visible; it now enforces a minimum window size [UUM-137119](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-137119) - Fixed the Action Maps list in the Input Actions editor losing keyboard focus after deleting a map, so that Delete, Duplicate, and arrow-key navigation kept working on the auto-selected replacement map without requiring an extra click [UUM-147152](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-147152) - Fixed the Device Simulator plugin keeping the real mouse and pen disabled while working in other Editor windows. Conflicting native `Mouse`/`Pen` devices are now only disabled while the Simulator window is focused and re-enabled as soon as focus moves elsewhere [UUM-145509](https://jira.unity3d.com/browse/UUM-145509). +- Fixed the Input Actions editor in Project Settings losing the selected action or binding when opening the control picker from the Path field [UUM-151771](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-151771). ## [1.20.0] - 2026-07-21 diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs index 27f4b93ed1..c036310b38 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs @@ -204,7 +204,19 @@ private void BuildUI() // Construct from InputSystem.actions asset var asset = InputSystem.actions; var hasAsset = asset != null; - m_State = (asset != null) ? new InputActionsEditorState(m_ActionEditorAnalytics, new SerializedObject(asset)) : default; + var assetGUID = hasAsset ? AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset)) : string.Empty; + + if (hasAsset) + { + // Seeding from the previous state preserves the action selection by GUID across asset saves, reimports, and initial builds. + var previousState = m_StateContainer?.assetGUID == assetGUID ? m_StateContainer.GetState() : default; + m_State = new InputActionsEditorState(previousState, new SerializedObject(asset)); + + // The seed carries the analytics session of whoever created it, so always use the current one. + m_State.m_Analytics = m_ActionEditorAnalytics; + } + else + m_State = default; // Dynamically show a section indicating that an asset is missing if not currently having an associated asset var missingAssetSection = m_RootVisualElement.Q("missing-asset-section"); @@ -252,7 +264,7 @@ private void BuildUI() // If the editor is associated with an asset we show input action editor if (hasAsset) { - m_StateContainer = new StateContainer(m_State, AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(asset))); + m_StateContainer = new StateContainer(m_State, assetGUID); m_View = new InputActionsEditorView(m_RootVisualElement, m_StateContainer, true, null); m_StateContainer.Initialize(m_RootVisualElement.Q("action-editor")); }