Skip to content

Commit 676d3c1

Browse files
authored
Merge branch 'develop' into update-docs-tooling
2 parents 362daf7 + 8216408 commit 676d3c1

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

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

1010
### Fixed
1111

12+
- 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)
13+
- Fixed the Input Actions editor window logging a "Failed to load asset" exception on editor startup when its saved window layout was restored in a project where the referenced asset GUID did not resolve; the window now closes quietly instead [UUM-144318](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144318)
1214
- 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)
1315
- Fixed the Input Actions editor toolbar buttons being clipped when the Action Properties panel grew tall enough to show a scrollbar
1416
- 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)

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ private void CreateGUI() // Only domain reload
208208
var asset = AssetDatabase.LoadAssetAtPath<InputActionAsset>(assetPath);
209209

210210
if (asset == null)
211-
throw new Exception($"Failed to load asset \"{assetPath}\". The file may have been deleted or moved.");
211+
{
212+
// Can happen when an asset is deleted while the window is open.
213+
// Delay the closure to avoid null-refs on repaint.
214+
EditorApplication.delayCall += Close;
215+
return;
216+
}
212217

213218
m_AssetJson = InputActionsEditorWindowUtils.ToJsonWithoutName(asset);
214219

Packages/com.unity.inputsystem/InputSystem/Runtime/Utilities/StringHelpers.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,18 @@ public static string MakeUniqueName<TExisting>(string baseName, IEnumerable<TExi
328328

329329
var name = baseName;
330330
var nameIsUnique = false;
331-
var namesTried = 1;
331+
var namesTried = 1L;
332332

333333
// If the name ends in digits, start counting from the given number.
334334
if (baseName.Length > 0)
335335
{
336336
var lastDigit = baseName.Length;
337337
while (lastDigit > 0 && char.IsDigit(baseName[lastDigit - 1]))
338338
--lastDigit;
339-
if (lastDigit != baseName.Length)
339+
if (lastDigit != baseName.Length &&
340+
long.TryParse(baseName.Substring(lastDigit), out var trailingNumber))
340341
{
341-
namesTried = int.Parse(baseName.Substring(lastDigit)) + 1;
342+
namesTried = trailingNumber + 1;
342343
baseName = baseName.Substring(0, lastDigit);
343344
}
344345
}

0 commit comments

Comments
 (0)