Skip to content

Commit b4c80b6

Browse files
FIX: Input System actions not auto-saving in Project Settings when both related windows were open (#2362)
1 parent 1943582 commit b4c80b6

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Fixed
1111

12+
- Fixed auto-save not working for Input System actions in Project Settings when both the Project Settings and Input System Actions windows were open [UUM-134035](https://jira.unity3d.com/browse/UUM-134035)
1213
- Improved New Input System warning dialog, Native Device Inputs Not Enabled [UUM-132151].
1314
- Fixed caching for InputControlPath display name [ISX-2501](https://jira.unity3d.com/browse/ISX-2501)
1415

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void ValidateAndSaveAsset(InputActionAsset asset)
178178
// This code should be cleaned up once we migrate the InputControl stuff from ImGUI completely.
179179
// Since at that point it stops being a separate window that steals focus.
180180
// (See case ISXB-1713)
181-
if (!InputEditorUserSettings.autoSaveInputActionAssets || m_View.IsControlSchemeViewActive())
181+
if (m_View.IsControlSchemeViewActive())
182182
{
183183
return;
184184
}
@@ -289,6 +289,8 @@ private void ModeChanged(PlayModeStateChange change)
289289
}
290290
}
291291

292+
internal static bool IsInputActionsPageActive => s_Provider != null && s_Provider.m_IsActivated;
293+
292294
[SettingsProvider]
293295
public static SettingsProvider CreateGlobalInputActionsEditorProvider()
294296
{

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,27 @@ private void BuildUI()
258258
rootVisualElement.Clear();
259259
if (!rootVisualElement.styleSheets.Contains(InputActionsEditorWindowUtils.theme))
260260
rootVisualElement.styleSheets.Add(InputActionsEditorWindowUtils.theme);
261+
262+
if (IsProjectSettingsWindowInputAsset() && InputActionsEditorSettingsProvider.IsInputActionsPageActive)
263+
{
264+
var helpBox = new HelpBox("This asset is assigned as the Project-wide Input Actions in Project Settings. Changes made here will affect input behavior across the entire project. Avoid editing this asset simultaneously in Project Settings windows.",
265+
HelpBoxMessageType.Warning);
266+
rootVisualElement.Add(helpBox);
267+
}
268+
261269
m_View = new InputActionsEditorView(rootVisualElement, m_StateContainer, false, () => Save(isAutoSave: false));
262270
m_StateContainer.Initialize(rootVisualElement.Q("action-editor"));
263271
}
264272

273+
private bool IsProjectSettingsWindowInputAsset()
274+
{
275+
var projectWideActions = InputSystem.actions;
276+
if (projectWideActions == null)
277+
return false;
278+
var path = AssetDatabase.GUIDToAssetPath(m_AssetGUID);
279+
return path == AssetDatabase.GetAssetPath(projectWideActions);
280+
}
281+
265282
private void OnStateChanged(InputActionsEditorState newState, UIRebuildMode editorRebuildMode)
266283
{
267284
DirtyInputActionsEditorWindow(newState);

0 commit comments

Comments
 (0)