-
Notifications
You must be signed in to change notification settings - Fork 329
FIX: InputActionMap warnings when the UI map is not setup correctly (ISXB-1560) #2229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Darren-Kelly-Unity
merged 18 commits into
develop
from
bugfix/ISXB-1560-inputactionmap-warnings
Sep 8, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6c1586c
Add fix for ISXB-1560 warnings issue.
Darren-Kelly-Unity 2efad11
Fix issue with all warning log's being shown when they shouldn't be.
Darren-Kelly-Unity bcae7e7
Update the changelog.
Darren-Kelly-Unity 0778d3e
Fix incorrect check caused by moving code while refactoring.
Darren-Kelly-Unity 284d736
Remove redundant using.
Darren-Kelly-Unity 56527d6
Add IsNullOrEmpty check as GetAsset can return null.
Darren-Kelly-Unity e74d53f
Merge branch 'develop' into bugfix/ISXB-1560-inputactionmap-warnings
Darren-Kelly-Unity 8ca84f4
Update code to reflect code reivew changes.
Darren-Kelly-Unity 76f6071
Fix changelog spacing.
Darren-Kelly-Unity ba8fc29
Add fix to only not show warnings when the UI action map is missing.
Darren-Kelly-Unity 8d7373e
Remove added whitespace.
Darren-Kelly-Unity 4cbf7ec
Add comment to explain the early return when not finding a UI action …
Darren-Kelly-Unity c4306ad
Add unit tests for testing against warnings that should be shown if a…
Darren-Kelly-Unity 62301af
Change test to have an empty action map in a better way.
Darren-Kelly-Unity b5ee4ff
Remove redundant using.
Darren-Kelly-Unity 6d0f19d
Fix formatting for InputForUITests.
Darren-Kelly-Unity 765ee06
Merge branch 'develop' into bugfix/ISXB-1560-inputactionmap-warnings
Darren-Kelly-Unity 4a697c3
Merge branch 'develop' into bugfix/ISXB-1560-inputactionmap-warnings
Darren-Kelly-Unity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -535,19 +535,31 @@ 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)); | ||
|
|
||
| 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(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had an issue here with Teardown logging the warnings again causing the logs to be there twice and fail. If you think I should do this another way let me know. |
||
| } | ||
|
|
||
| [Test(Description = "Verifies that user-supplied project-wide input actions generates warnings if any required action is missing.")] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.