From e2b8de46cba0d6a86ef3a8e2ed1368ed0566795a Mon Sep 17 00:00:00 2001 From: Lyndon Homewood Date: Fri, 26 Jan 2024 11:14:51 +0000 Subject: [PATCH 1/6] Reset now clears out old Input Action Assets and Input Action References first --- .../ProjectWideActionsAsset.cs | 49 ++++++++++++++++++- .../UITKAssetEditor/Commands/Commands.cs | 3 +- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs index e20bedefd4..efe6e214f1 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs @@ -112,9 +112,12 @@ private static void CreateInputActionReferences(InputActionAsset asset) AssetDatabase.AddObjectToAsset(actionReference, asset); } } + + AssetDatabase.SaveAssets(); } - #if UNITY_2023_2_OR_NEWER + +#if UNITY_2023_2_OR_NEWER /// /// Checks if the default UI action map has been modified or removed, to let the user know if their changes will /// break the UI input at runtime, when using the UI Toolkit. @@ -147,7 +150,47 @@ internal static void CheckForDefaultUIActionMapChanges() } } - #endif +#endif + /// + /// Reset project wide input actions asset + /// + /// + internal static void ResetActionAsset() + { + DeleteActionAsset(); + + // Note the window can refresh between deletion and creation so we should only re-create if not present + GetOrCreate(); + } + + /// + /// Delete project wide input actions + /// + /// + internal static void DeleteActionAsset() + { + var objects = AssetDatabase.LoadAllAssetsAtPath(s_AssetPath); + if (objects != null) + { + // Handle deleting all InputActionAssets as older 1.8.0 pre release could create more than one project wide input asset in the file + foreach (var obj in objects) + { + if (obj is InputActionReference) + { + var actionReference = obj as InputActionReference; + actionReference.Set(null); + AssetDatabase.RemoveObjectFromAsset(obj); + } + else if (obj is InputActionAsset) + { + AssetDatabase.RemoveObjectFromAsset(obj); + } + } + + AssetDatabase.SaveAssets(); + } + } + /// /// Updates the input action references in the asset by updating names, removing dangling references @@ -195,6 +238,8 @@ internal static void UpdateInputActionReferences() } } } + + AssetDatabase.SaveAssets(); } } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs index fe0f9763a4..d0eed0dce2 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs @@ -425,7 +425,8 @@ public static Command ResetGlobalInputAsset(Action postResetAc { return (in InputActionsEditorState state) => { - var asset = ProjectWideActionsAsset.CreateNewActionAsset(); + ProjectWideActionsAsset.ResetActionAsset(); + var asset = ProjectWideActionsAsset.GetOrCreate(); postResetAction?.Invoke(asset); return state; }; From 638560a905f9090ab1eadc920dc2e049421a9d29 Mon Sep 17 00:00:00 2001 From: Lyndon Homewood Date: Fri, 26 Jan 2024 11:22:26 +0000 Subject: [PATCH 2/6] Added change log and formatting fix --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../Editor/ProjectWideActions/ProjectWideActionsAsset.cs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 563ff90414..6ef04df307 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -34,6 +34,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed issue where composite part dropdown manipulates binding path and leaves composite part field unchanged. - Fixed lingering highlight effect on Save Asset button after clicking. - Fixed missing name in window title for Input Action assets. +- Fixed InputManager.asset file growing in size on each Reset call (ISX-1839) ## [1.8.0-pre.2] - 2023-11-09 diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs index efe6e214f1..603dcf3aa5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs @@ -116,7 +116,6 @@ private static void CreateInputActionReferences(InputActionAsset asset) AssetDatabase.SaveAssets(); } - #if UNITY_2023_2_OR_NEWER /// /// Checks if the default UI action map has been modified or removed, to let the user know if their changes will @@ -152,7 +151,7 @@ internal static void CheckForDefaultUIActionMapChanges() #endif /// - /// Reset project wide input actions asset + /// Reset project wide input actions asset /// /// internal static void ResetActionAsset() @@ -191,7 +190,6 @@ internal static void DeleteActionAsset() } } - /// /// Updates the input action references in the asset by updating names, removing dangling references /// and adding new ones. From 9e96040ea3724c23dce357455c9eb614dcf82680 Mon Sep 17 00:00:00 2001 From: Lyndon Homewood <33493311+lyndon-unity@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:21:07 +0000 Subject: [PATCH 3/6] Update CHANGELOG.md Removed internal bug id and added full stop --- Packages/com.unity.inputsystem/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 6ef04df307..564a0b0777 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -34,7 +34,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed issue where composite part dropdown manipulates binding path and leaves composite part field unchanged. - Fixed lingering highlight effect on Save Asset button after clicking. - Fixed missing name in window title for Input Action assets. -- Fixed InputManager.asset file growing in size on each Reset call (ISX-1839) +- Fixed InputManager.asset file growing in size on each Reset call. ## [1.8.0-pre.2] - 2023-11-09 From 925b2e0faf4eaa09cc05e643b9de540d98f8af63 Mon Sep 17 00:00:00 2001 From: Lyndon Homewood Date: Wed, 31 Jan 2024 12:08:25 +0000 Subject: [PATCH 4/6] Moved the DeleteActionAsset call into CreateNewActionAsset to make sure we never create duplicates Added Start/EndAssetEditing calls to try and make the serialisation code more atomic Removed some unused param fields in the docs Removed some excessiver SaveAssets calls --- .../ProjectWideActionsAsset.cs | 183 +++++++++++------- 1 file changed, 108 insertions(+), 75 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs index 603dcf3aa5..cc9d7f8a83 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs @@ -53,42 +53,58 @@ internal static InputActionAsset GetOrCreate() internal static InputActionAsset CreateNewActionAsset() { + // Always clean out old actions asset and action references first before we add new + DeleteActionAssetAndActionReferences(); + + // Create new asset data var json = File.ReadAllText(FileUtil.GetPhysicalPath(s_DefaultAssetPath)); var asset = ScriptableObject.CreateInstance(); asset.LoadFromJson(json); asset.name = kAssetName; - AssetDatabase.AddObjectToAsset(asset, s_AssetPath); - - // Make sure all the elements in the asset have GUIDs and that they are indeed unique. - var maps = asset.actionMaps; - foreach (var map in maps) + try { - // Make sure action map has GUID. - if (string.IsNullOrEmpty(map.m_Id) || asset.actionMaps.Count(x => x.m_Id == map.m_Id) > 1) - map.GenerateId(); + //Place the Asset Database in a state where + //importing is suspended for most APIs + AssetDatabase.StartAssetEditing(); - // Make sure all actions have GUIDs. - foreach (var action in map.actions) - { - var actionId = action.m_Id; - if (string.IsNullOrEmpty(actionId) || asset.actionMaps.Sum(m => m.actions.Count(a => a.m_Id == actionId)) > 1) - action.GenerateId(); - } + AssetDatabase.AddObjectToAsset(asset, s_AssetPath); - // Make sure all bindings have GUIDs. - for (var i = 0; i < map.m_Bindings.LengthSafe(); ++i) + // Make sure all the elements in the asset have GUIDs and that they are indeed unique. + var maps = asset.actionMaps; + foreach (var map in maps) { - var bindingId = map.m_Bindings[i].m_Id; - if (string.IsNullOrEmpty(bindingId) || asset.actionMaps.Sum(m => m.bindings.Count(b => b.m_Id == bindingId)) > 1) - map.m_Bindings[i].GenerateId(); - } - } + // Make sure action map has GUID. + if (string.IsNullOrEmpty(map.m_Id) || asset.actionMaps.Count(x => x.m_Id == map.m_Id) > 1) + map.GenerateId(); - CreateInputActionReferences(asset); + // Make sure all actions have GUIDs. + foreach (var action in map.actions) + { + var actionId = action.m_Id; + if (string.IsNullOrEmpty(actionId) || asset.actionMaps.Sum(m => m.actions.Count(a => a.m_Id == actionId)) > 1) + action.GenerateId(); + } - AssetDatabase.SaveAssets(); + // Make sure all bindings have GUIDs. + for (var i = 0; i < map.m_Bindings.LengthSafe(); ++i) + { + var bindingId = map.m_Bindings[i].m_Id; + if (string.IsNullOrEmpty(bindingId) || asset.actionMaps.Sum(m => m.bindings.Count(b => b.m_Id == bindingId)) > 1) + map.m_Bindings[i].GenerateId(); + } + } + + CreateInputActionReferences(asset); + } + finally + { + //By adding a call to StopAssetEditing inside + //a "finally" block, we ensure the AssetDatabase + //state will be reset when leaving this function + AssetDatabase.StopAssetEditing(); + } return asset; } @@ -112,8 +128,6 @@ private static void CreateInputActionReferences(InputActionAsset asset) AssetDatabase.AddObjectToAsset(actionReference, asset); } } - - AssetDatabase.SaveAssets(); } #if UNITY_2023_2_OR_NEWER @@ -153,40 +167,47 @@ internal static void CheckForDefaultUIActionMapChanges() /// /// Reset project wide input actions asset /// - /// internal static void ResetActionAsset() { - DeleteActionAsset(); - - // Note the window can refresh between deletion and creation so we should only re-create if not present - GetOrCreate(); + CreateNewActionAsset(); } /// /// Delete project wide input actions /// - /// - internal static void DeleteActionAsset() + internal static void DeleteActionAssetAndActionReferences() { var objects = AssetDatabase.LoadAllAssetsAtPath(s_AssetPath); if (objects != null) { - // Handle deleting all InputActionAssets as older 1.8.0 pre release could create more than one project wide input asset in the file - foreach (var obj in objects) + try { - if (obj is InputActionReference) - { - var actionReference = obj as InputActionReference; - actionReference.Set(null); - AssetDatabase.RemoveObjectFromAsset(obj); - } - else if (obj is InputActionAsset) + //Place the Asset Database in a state where + //importing is suspended for most APIs + AssetDatabase.StartAssetEditing(); + + // Handle deleting all InputActionAssets as older 1.8.0 pre release could create more than one project wide input asset in the file + foreach (var obj in objects) { - AssetDatabase.RemoveObjectFromAsset(obj); + if (obj is InputActionReference) + { + var actionReference = obj as InputActionReference; + actionReference.Set(null); + AssetDatabase.RemoveObjectFromAsset(obj); + } + else if (obj is InputActionAsset) + { + AssetDatabase.RemoveObjectFromAsset(obj); + } } } - - AssetDatabase.SaveAssets(); + finally + { + //By adding a call to StopAssetEditing inside + //a "finally" block, we ensure the AssetDatabase + //state will be reset when leaving this function + AssetDatabase.StopAssetEditing(); + } } } @@ -194,50 +215,62 @@ internal static void DeleteActionAsset() /// Updates the input action references in the asset by updating names, removing dangling references /// and adding new ones. /// - /// internal static void UpdateInputActionReferences() { - var asset = GetOrCreate(); + InputActionAsset asset = GetOrCreate(); var existingReferences = InputActionImporter.LoadInputActionReferencesFromAsset(asset).ToList(); - // Check if referenced input action exists in the asset and remove the reference if it doesn't. - foreach (var actionReference in existingReferences) - { - if (actionReference.action != null && asset.FindAction(actionReference.action.id) == null) - { - actionReference.Set(null); - AssetDatabase.RemoveObjectFromAsset(actionReference); - } - } - - // Check if all actions have a reference - foreach (var action in asset) + try { - // Catch error that's possible to appear in previous versions of the package. - if (action.actionMap.m_Asset == null) - action.actionMap.m_Asset = asset; + //Place the Asset Database in a state where + //importing is suspended for most APIs + AssetDatabase.StartAssetEditing(); - var actionReference = existingReferences.FirstOrDefault(r => r.m_ActionId == action.id.ToString()); - // The input action doesn't have a reference, create a new one. - if (actionReference == null) + // Check if referenced input action exists in the asset and remove the reference if it doesn't. + foreach (var actionReference in existingReferences) { - var actionReferenceNew = ScriptableObject.CreateInstance(); - actionReferenceNew.Set(action); - AssetDatabase.AddObjectToAsset(actionReferenceNew, asset); + if (actionReference.action != null && asset.FindAction(actionReference.action.id) == null) + { + actionReference.Set(null); + AssetDatabase.RemoveObjectFromAsset(actionReference); + } } - else + + // Check if all actions have a reference + foreach (var action in asset) { - // Update the name of the reference if it doesn't match the action name. - if (actionReference.name != InputActionReference.GetDisplayName(action)) + // Catch error that's possible to appear in previous versions of the package. + if (action.actionMap.m_Asset == null) + action.actionMap.m_Asset = asset; + + var actionReference = existingReferences.FirstOrDefault(r => r.m_ActionId == action.id.ToString()); + // The input action doesn't have a reference, create a new one. + if (actionReference == null) { - AssetDatabase.RemoveObjectFromAsset(actionReference); - actionReference.name = InputActionReference.GetDisplayName(action); - AssetDatabase.AddObjectToAsset(actionReference, asset); + var actionReferenceNew = ScriptableObject.CreateInstance(); + actionReferenceNew.Set(action); + AssetDatabase.AddObjectToAsset(actionReferenceNew, asset); + } + else + { + // Update the name of the reference if it doesn't match the action name. + if (actionReference.name != InputActionReference.GetDisplayName(action)) + { + AssetDatabase.RemoveObjectFromAsset(actionReference); + actionReference.name = InputActionReference.GetDisplayName(action); + AssetDatabase.AddObjectToAsset(actionReference, asset); + } } } } + finally + { + //By adding a call to StopAssetEditing inside + //a "finally" block, we ensure the AssetDatabase + //state will be reset when leaving this function + AssetDatabase.StopAssetEditing(); + } - AssetDatabase.SaveAssets(); } } } From 117b870e981e09fb2e082bc6e723cf19de258ca1 Mon Sep 17 00:00:00 2001 From: Lyndon Homewood Date: Wed, 31 Jan 2024 12:50:20 +0000 Subject: [PATCH 5/6] Removed StartAssetEditing at AssetDatabase team recommendation as it doesn't actually impact AddObjectToAsset --- .../ProjectWideActionsAsset.cs | 162 +++++++----------- 1 file changed, 61 insertions(+), 101 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs index cc9d7f8a83..d6e89ff618 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs @@ -63,49 +63,36 @@ internal static InputActionAsset CreateNewActionAsset() asset.LoadFromJson(json); asset.name = kAssetName; - try - { - //Place the Asset Database in a state where - //importing is suspended for most APIs - AssetDatabase.StartAssetEditing(); + AssetDatabase.AddObjectToAsset(asset, s_AssetPath); - AssetDatabase.AddObjectToAsset(asset, s_AssetPath); + // Make sure all the elements in the asset have GUIDs and that they are indeed unique. + var maps = asset.actionMaps; + foreach (var map in maps) + { + // Make sure action map has GUID. + if (string.IsNullOrEmpty(map.m_Id) || asset.actionMaps.Count(x => x.m_Id == map.m_Id) > 1) + map.GenerateId(); - // Make sure all the elements in the asset have GUIDs and that they are indeed unique. - var maps = asset.actionMaps; - foreach (var map in maps) + // Make sure all actions have GUIDs. + foreach (var action in map.actions) { - // Make sure action map has GUID. - if (string.IsNullOrEmpty(map.m_Id) || asset.actionMaps.Count(x => x.m_Id == map.m_Id) > 1) - map.GenerateId(); - - // Make sure all actions have GUIDs. - foreach (var action in map.actions) - { - var actionId = action.m_Id; - if (string.IsNullOrEmpty(actionId) || asset.actionMaps.Sum(m => m.actions.Count(a => a.m_Id == actionId)) > 1) - action.GenerateId(); - } - - // Make sure all bindings have GUIDs. - for (var i = 0; i < map.m_Bindings.LengthSafe(); ++i) - { - var bindingId = map.m_Bindings[i].m_Id; - if (string.IsNullOrEmpty(bindingId) || asset.actionMaps.Sum(m => m.bindings.Count(b => b.m_Id == bindingId)) > 1) - map.m_Bindings[i].GenerateId(); - } + var actionId = action.m_Id; + if (string.IsNullOrEmpty(actionId) || asset.actionMaps.Sum(m => m.actions.Count(a => a.m_Id == actionId)) > 1) + action.GenerateId(); } - CreateInputActionReferences(asset); - } - finally - { - //By adding a call to StopAssetEditing inside - //a "finally" block, we ensure the AssetDatabase - //state will be reset when leaving this function - AssetDatabase.StopAssetEditing(); + // Make sure all bindings have GUIDs. + for (var i = 0; i < map.m_Bindings.LengthSafe(); ++i) + { + var bindingId = map.m_Bindings[i].m_Id; + if (string.IsNullOrEmpty(bindingId) || asset.actionMaps.Sum(m => m.bindings.Count(b => b.m_Id == bindingId)) > 1) + map.m_Bindings[i].GenerateId(); + } } + CreateInputActionReferences(asset); + AssetDatabase.SaveAssets(); + return asset; } @@ -180,33 +167,19 @@ internal static void DeleteActionAssetAndActionReferences() var objects = AssetDatabase.LoadAllAssetsAtPath(s_AssetPath); if (objects != null) { - try + // Handle deleting all InputActionAssets as older 1.8.0 pre release could create more than one project wide input asset in the file + foreach (var obj in objects) { - //Place the Asset Database in a state where - //importing is suspended for most APIs - AssetDatabase.StartAssetEditing(); - - // Handle deleting all InputActionAssets as older 1.8.0 pre release could create more than one project wide input asset in the file - foreach (var obj in objects) + if (obj is InputActionReference) { - if (obj is InputActionReference) - { - var actionReference = obj as InputActionReference; - actionReference.Set(null); - AssetDatabase.RemoveObjectFromAsset(obj); - } - else if (obj is InputActionAsset) - { - AssetDatabase.RemoveObjectFromAsset(obj); - } + var actionReference = obj as InputActionReference; + actionReference.Set(null); + AssetDatabase.RemoveObjectFromAsset(obj); + } + else if (obj is InputActionAsset) + { + AssetDatabase.RemoveObjectFromAsset(obj); } - } - finally - { - //By adding a call to StopAssetEditing inside - //a "finally" block, we ensure the AssetDatabase - //state will be reset when leaving this function - AssetDatabase.StopAssetEditing(); } } } @@ -220,57 +193,44 @@ internal static void UpdateInputActionReferences() InputActionAsset asset = GetOrCreate(); var existingReferences = InputActionImporter.LoadInputActionReferencesFromAsset(asset).ToList(); - try + // Check if referenced input action exists in the asset and remove the reference if it doesn't. + foreach (var actionReference in existingReferences) { - //Place the Asset Database in a state where - //importing is suspended for most APIs - AssetDatabase.StartAssetEditing(); - - // Check if referenced input action exists in the asset and remove the reference if it doesn't. - foreach (var actionReference in existingReferences) + if (actionReference.action != null && asset.FindAction(actionReference.action.id) == null) { - if (actionReference.action != null && asset.FindAction(actionReference.action.id) == null) - { - actionReference.Set(null); - AssetDatabase.RemoveObjectFromAsset(actionReference); - } + actionReference.Set(null); + AssetDatabase.RemoveObjectFromAsset(actionReference); } + } - // Check if all actions have a reference - foreach (var action in asset) - { - // Catch error that's possible to appear in previous versions of the package. - if (action.actionMap.m_Asset == null) - action.actionMap.m_Asset = asset; + // Check if all actions have a reference + foreach (var action in asset) + { + // Catch error that's possible to appear in previous versions of the package. + if (action.actionMap.m_Asset == null) + action.actionMap.m_Asset = asset; - var actionReference = existingReferences.FirstOrDefault(r => r.m_ActionId == action.id.ToString()); - // The input action doesn't have a reference, create a new one. - if (actionReference == null) - { - var actionReferenceNew = ScriptableObject.CreateInstance(); - actionReferenceNew.Set(action); - AssetDatabase.AddObjectToAsset(actionReferenceNew, asset); - } - else + var actionReference = existingReferences.FirstOrDefault(r => r.m_ActionId == action.id.ToString()); + // The input action doesn't have a reference, create a new one. + if (actionReference == null) + { + var actionReferenceNew = ScriptableObject.CreateInstance(); + actionReferenceNew.Set(action); + AssetDatabase.AddObjectToAsset(actionReferenceNew, asset); + } + else + { + // Update the name of the reference if it doesn't match the action name. + if (actionReference.name != InputActionReference.GetDisplayName(action)) { - // Update the name of the reference if it doesn't match the action name. - if (actionReference.name != InputActionReference.GetDisplayName(action)) - { - AssetDatabase.RemoveObjectFromAsset(actionReference); - actionReference.name = InputActionReference.GetDisplayName(action); - AssetDatabase.AddObjectToAsset(actionReference, asset); - } + AssetDatabase.RemoveObjectFromAsset(actionReference); + actionReference.name = InputActionReference.GetDisplayName(action); + AssetDatabase.AddObjectToAsset(actionReference, asset); } } } - finally - { - //By adding a call to StopAssetEditing inside - //a "finally" block, we ensure the AssetDatabase - //state will be reset when leaving this function - AssetDatabase.StopAssetEditing(); - } + AssetDatabase.SaveAssets(); } } } From ac5ec5c9b57ff91bc9d0215b5b1809856cf91bf9 Mon Sep 17 00:00:00 2001 From: Lyndon Homewood Date: Wed, 31 Jan 2024 12:55:06 +0000 Subject: [PATCH 6/6] Formatting fix --- .../Editor/ProjectWideActions/ProjectWideActionsAsset.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs index d6e89ff618..f56024fa49 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs @@ -53,7 +53,7 @@ internal static InputActionAsset GetOrCreate() internal static InputActionAsset CreateNewActionAsset() { - // Always clean out old actions asset and action references first before we add new + // Always clean out old actions asset and action references first before we add new DeleteActionAssetAndActionReferences(); // Create new asset data @@ -190,7 +190,7 @@ internal static void DeleteActionAssetAndActionReferences() /// internal static void UpdateInputActionReferences() { - InputActionAsset asset = GetOrCreate(); + var asset = GetOrCreate(); var existingReferences = InputActionImporter.LoadInputActionReferencesFromAsset(asset).ToList(); // Check if referenced input action exists in the asset and remove the reference if it doesn't.