diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index daa76888d1..dc9b4d7131 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fixed an `OverflowException` when creating a control scheme (or other named item) whose all-numeric name exceeds `Int32.MaxValue`, which previously discarded the entered name and fell back to the default [UUM-145766](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-145766) - Empty foldouts are no longer shown for processors and interactions that have no settings (e.g. "Invert") [UUM-144325](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144325) - Fixed the Input Actions editor toolbar buttons being clipped when the Action Properties panel grew tall enough to show a scrollbar - Fixed the Control Schemes dropdown in the Input Actions editor continuing to display a deleted scheme's name after the last control scheme was removed, instead of resetting to "No Control Schemes" until the asset was saved or the editor reopened. [UUM-141563](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-141563) diff --git a/Packages/com.unity.inputsystem/InputSystem/Runtime/Utilities/StringHelpers.cs b/Packages/com.unity.inputsystem/InputSystem/Runtime/Utilities/StringHelpers.cs index 56991ebe5b..6a0e9937ee 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Runtime/Utilities/StringHelpers.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Runtime/Utilities/StringHelpers.cs @@ -328,7 +328,7 @@ public static string MakeUniqueName(string baseName, IEnumerable 0) @@ -336,9 +336,10 @@ public static string MakeUniqueName(string baseName, IEnumerable 0 && char.IsDigit(baseName[lastDigit - 1])) --lastDigit; - if (lastDigit != baseName.Length) + if (lastDigit != baseName.Length && + long.TryParse(baseName.Substring(lastDigit), out var trailingNumber)) { - namesTried = int.Parse(baseName.Substring(lastDigit)) + 1; + namesTried = trailingNumber + 1; baseName = baseName.Substring(0, lastDigit); } }