From 241ea6cb3cb20ce0b3b9f4ece9fdd4114b28d777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Malrat?= Date: Thu, 18 Jul 2024 14:27:49 +0200 Subject: [PATCH 1/3] fixed InputActionCodeGenerator if an action map is named debug --- Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs | 3 +-- .../Editor/AssetImporter/InputActionCodeGenerator.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs index b4dc55fafd..47989e5de4 100644 --- a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs +++ b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; -using UnityEngine; public partial class @InputActionCodeGeneratorActions: IInputActionCollection2, IDisposable { @@ -83,7 +82,7 @@ public @InputActionCodeGeneratorActions() ~@InputActionCodeGeneratorActions() { - Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, InputActionCodeGeneratorActions.gameplay.Disable() has not been called."); + UnityEngine.Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, InputActionCodeGeneratorActions.gameplay.Disable() has not been called."); } public void Dispose() diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs index 1e45e37632..dab46023da 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs @@ -83,7 +83,6 @@ public static string GenerateWrapperCode(InputActionAsset asset, Options options writer.WriteLine("using System.Collections.Generic;"); writer.WriteLine("using UnityEngine.InputSystem;"); writer.WriteLine("using UnityEngine.InputSystem.Utilities;"); - writer.WriteLine("using UnityEngine;"); writer.WriteLine(""); // Begin namespace. @@ -127,7 +126,7 @@ public static string GenerateWrapperCode(InputActionAsset asset, Options options foreach (var map in maps) { var mapName = CSharpCodeHelpers.MakeIdentifier(map.name); - writer.WriteLine($"Debug.Assert(!m_{mapName}.enabled, \"This will cause a leak and performance issues, {options.className}.{mapName}.Disable() has not been called.\");"); + writer.WriteLine($"UnityEngine.Debug.Assert(!m_{mapName}.enabled, \"This will cause a leak and performance issues, {options.className}.{mapName}.Disable() has not been called.\");"); } writer.EndBlock(); writer.WriteLine(); From 74f7756a8f7eb1cc4580e61ec32808f7839e616e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Malrat?= Date: Thu, 18 Jul 2024 14:54:52 +0200 Subject: [PATCH 2/3] add changelog --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index c7175a3c70..bb22477046 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests. ### Fixed - Fixed default scroll speed in uGUI being slower than before. [ISXB-766](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-766) - Fixed an issue when multiple interactions drive an action and perform during the cancelation of the current active interaction [ISXB-310](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-310). +- Fixed an issue when generating C# class of Input Actions that contain an action map named `Debug` [ISXB-851](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-851). ### Added - Added `InputSystemUIInputModule.scrollDeltaPerTick` property, a customizable multiplicative factor applied to the scroll wheel speed before it is sent to UI components. Note that this has no effect on UI Toolkit content, only uGUI. From 6b12e2aedcd36647f89be911081f03cb96aa9dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Malrat?= Date: Thu, 18 Jul 2024 15:10:24 +0200 Subject: [PATCH 3/3] update samples --- Assets/Samples/InGameHints/InGameHintsActions.cs | 3 +-- Assets/Samples/SimpleDemo/SimpleControls.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Samples/InGameHints/InGameHintsActions.cs b/Assets/Samples/InGameHints/InGameHintsActions.cs index 5c880a15b2..4bd926e78d 100644 --- a/Assets/Samples/InGameHints/InGameHintsActions.cs +++ b/Assets/Samples/InGameHints/InGameHintsActions.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; -using UnityEngine; namespace UnityEngine.InputSystem.Samples.InGameHints { @@ -275,7 +274,7 @@ public @InGameHintsActions() ~@InGameHintsActions() { - Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called."); + UnityEngine.Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called."); } public void Dispose() diff --git a/Assets/Samples/SimpleDemo/SimpleControls.cs b/Assets/Samples/SimpleDemo/SimpleControls.cs index 279e3117eb..cb5972b685 100644 --- a/Assets/Samples/SimpleDemo/SimpleControls.cs +++ b/Assets/Samples/SimpleDemo/SimpleControls.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; -using UnityEngine; public partial class @SimpleControls: IInputActionCollection2, IDisposable { @@ -170,7 +169,7 @@ public @SimpleControls() ~@SimpleControls() { - Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, SimpleControls.gameplay.Disable() has not been called."); + UnityEngine.Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, SimpleControls.gameplay.Disable() has not been called."); } public void Dispose()