Skip to content

Commit 5e1b12d

Browse files
authored
FIX: InputActionCodeGenerator if an action map is named debug (ISXB-851) (#1968)
* fixed InputActionCodeGenerator if an action map is named debug * add changelog * update samples
1 parent 21726c7 commit 5e1b12d

5 files changed

Lines changed: 5 additions & 8 deletions

File tree

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Collections.Generic;
1515
using UnityEngine.InputSystem;
1616
using UnityEngine.InputSystem.Utilities;
17-
using UnityEngine;
1817

1918
namespace UnityEngine.InputSystem.Samples.InGameHints
2019
{
@@ -275,7 +274,7 @@ public @InGameHintsActions()
275274

276275
~@InGameHintsActions()
277276
{
278-
Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called.");
277+
UnityEngine.Debug.Assert(!m_Gameplay.enabled, "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called.");
279278
}
280279

281280
public void Dispose()

Assets/Samples/SimpleDemo/SimpleControls.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Collections.Generic;
1515
using UnityEngine.InputSystem;
1616
using UnityEngine.InputSystem.Utilities;
17-
using UnityEngine;
1817

1918
public partial class @SimpleControls: IInputActionCollection2, IDisposable
2019
{
@@ -170,7 +169,7 @@ public @SimpleControls()
170169

171170
~@SimpleControls()
172171
{
173-
Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, SimpleControls.gameplay.Disable() has not been called.");
172+
UnityEngine.Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, SimpleControls.gameplay.Disable() has not been called.");
174173
}
175174

176175
public void Dispose()

Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Collections.Generic;
1515
using UnityEngine.InputSystem;
1616
using UnityEngine.InputSystem.Utilities;
17-
using UnityEngine;
1817

1918
public partial class @InputActionCodeGeneratorActions: IInputActionCollection2, IDisposable
2019
{
@@ -83,7 +82,7 @@ public @InputActionCodeGeneratorActions()
8382

8483
~@InputActionCodeGeneratorActions()
8584
{
86-
Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, InputActionCodeGeneratorActions.gameplay.Disable() has not been called.");
85+
UnityEngine.Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, InputActionCodeGeneratorActions.gameplay.Disable() has not been called.");
8786
}
8887

8988
public void Dispose()

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests.
1313
### Fixed
1414
- Fixed default scroll speed in uGUI being slower than before. [ISXB-766](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-766)
1515
- 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).
16+
- 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).
1617

1718
### Added
1819
- 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.

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public static string GenerateWrapperCode(InputActionAsset asset, Options options
8383
writer.WriteLine("using System.Collections.Generic;");
8484
writer.WriteLine("using UnityEngine.InputSystem;");
8585
writer.WriteLine("using UnityEngine.InputSystem.Utilities;");
86-
writer.WriteLine("using UnityEngine;");
8786
writer.WriteLine("");
8887

8988
// Begin namespace.
@@ -127,7 +126,7 @@ public static string GenerateWrapperCode(InputActionAsset asset, Options options
127126
foreach (var map in maps)
128127
{
129128
var mapName = CSharpCodeHelpers.MakeIdentifier(map.name);
130-
writer.WriteLine($"Debug.Assert(!m_{mapName}.enabled, \"This will cause a leak and performance issues, {options.className}.{mapName}.Disable() has not been called.\");");
129+
writer.WriteLine($"UnityEngine.Debug.Assert(!m_{mapName}.enabled, \"This will cause a leak and performance issues, {options.className}.{mapName}.Disable() has not been called.\");");
131130
}
132131
writer.EndBlock();
133132
writer.WriteLine();

0 commit comments

Comments
 (0)