diff --git a/Assets/Tests/InputSystem/Plugins/InputForUITests.cs b/Assets/Tests/InputSystem/Plugins/InputForUITests.cs index 983703be7e..7deb3e95c4 100644 --- a/Assets/Tests/InputSystem/Plugins/InputForUITests.cs +++ b/Assets/Tests/InputSystem/Plugins/InputForUITests.cs @@ -535,10 +535,9 @@ public void DefaultActions_ShouldNotGenerateAnyVerificationWarnings(bool useProj LogAssert.NoUnexpectedReceived(); } - [Ignore("We currently allow a PWA asset without an UI action map and rely on defaults instead. This allows users that do not want it or use something else to avoid using it.")] - [Test(Description = "Verifies that user-supplied project-wide input actions generates warnings if action map is missing.")] + [Test(Description = "Verifies that user-supplied project-wide actions do not generate warnings if action map is missing. We use default actions in this case.")] [Category(kTestCategory)] - public void ActionsWithoutUIMap_ShouldGenerateWarnings() + public void ActionsWithoutUIMap_ShouldNotGenerateWarnings() { var asset = ProjectWideActionsAsset.CreateDefaultAssetAtPath(kAssetPath); asset.RemoveActionMap(asset.FindActionMap("UI", throwIfNotFound: true)); @@ -546,8 +545,21 @@ public void ActionsWithoutUIMap_ShouldGenerateWarnings() InputSystem.s_Manager.actions = asset; Update(); + LogAssert.NoUnexpectedReceived(); + } + + [Test(Description = "Verifies that user-supplied project-wide input actions generates warnings if the UI map is present but actions are missing.")] + [Category(kTestCategory)] + public void ActionsWithUIMap_MissingActions_ShouldGenerateWarnings() + { + var asset = ProjectWideActionsAsset.CreateDefaultAssetAtPath(kAssetPath); + asset.RemoveActionMap(asset.FindActionMap("UI", throwIfNotFound: true)); + asset.AddActionMap(new InputActionMap("UI")); // An empty UI map should log warnings. + + InputSystem.s_Manager.actions = asset; + Update(); + var link = EditorHelpers.GetHyperlink(kAssetPath); - LogAssert.Expect(LogType.Warning, new Regex($"^InputActionMap with path 'UI' in asset '{link}' could not be found.")); if (InputActionAssetVerifier.DefaultReportPolicy == InputActionAssetVerifier.ReportPolicy.ReportAll) { LogAssert.Expect(LogType.Warning, new Regex($"^InputAction with path 'UI/Point' in asset '{link}' could not be found.")); @@ -559,8 +571,6 @@ public void ActionsWithoutUIMap_ShouldGenerateWarnings() LogAssert.Expect(LogType.Warning, new Regex($"^InputAction with path 'UI/RightClick' in asset '{link}' could not be found.")); LogAssert.Expect(LogType.Warning, new Regex($"^InputAction with path 'UI/ScrollWheel' in asset '{link}' could not be found.")); } - // else: expect suppression of child errors - LogAssert.NoUnexpectedReceived(); } [Test(Description = "Verifies that user-supplied project-wide input actions generates warnings if any required action is missing.")] diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 85f38d4138..773c3d3fbe 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -31,6 +31,7 @@ however, it has to be formatted properly to pass verification tests. ### Fixed - Fixed an issue where using Pen devices on Android tablets would result in double clicks for UI interactions. [ISXB-1456](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1456) - Fixed an issue preventing an embedded platform from being released. It adds back some `#defines` to `XRSupport` and `InputDeviceCharacteristics`. +- Fixed a warning not showing the asset name correctly when the input action map parameters for runtime GUI were not setup. [ISXB-1560] ## [1.14.1] - 2025-07-10 diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/InputForUI/InputActionAssetVerifier.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/InputForUI/InputActionAssetVerifier.cs index f42433be8b..a8176460df 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/InputForUI/InputActionAssetVerifier.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/InputForUI/InputActionAssetVerifier.cs @@ -32,6 +32,12 @@ static InputActionAssetVerifier() public void Verify(InputActionAsset asset, ProjectWideActionsAsset.IReportInputActionAssetVerificationErrors reporter) { + // We don't want to log warnings if no UI action map is present as we default in this case. + if (asset.FindActionMap("UI", false) == null) + { + return; + } + // Note: // PWA has initial state check true for "Point" action, DefaultActions do not, does it matter? // @@ -70,7 +76,7 @@ public Context(InputActionAsset asset, private string GetAssetReference() { var path = AssetDatabase.GetAssetPath(asset); - return path ?? asset.name; + return string.IsNullOrEmpty(path) ? asset.name : path; } private void ActionMapWarning(string actionMap, string problem)