-
Notifications
You must be signed in to change notification settings - Fork 330
CHANGE: Update Input for UI provider to use project-wide input actions #1807
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
CHANGE: Update Input for UI provider to use project-wide input actions #1807
Conversation
0856332 to
0bdd4a6
Compare
ritamerkl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ekcoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general. I think we can skip the caching or was it taking a long time that drived the decision to cache in s_DefaultUIMap?
I also believe it would be good to add a test to cover CheckFirDefaultUIActionMapChanges.
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
ekcoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another one, CHANGELOG.md entry seems to be missing.
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Plugins/InputForUI/InputSystemProvider.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Outdated
Show resolved
Hide resolved
|
I think for the first pass, it is enough that InputForUI just uses UI improvements like blocking editing the UI action names, warnings, or resetUI map, would take more time. |
|
@Pauliusd01 regarding testing, you can try to play around with removing the UI action map, UI actions, or changing the bindings like we discussed in the daily sync. You should still see the events in the right column the Visualizer test project scene. And should get appropriate warning and error messages. There are already some warning messages once the asset is saved and you rename the UI action map and its actions. |
|
@Pauliusd01 I put the wrong image before, I updated it now |
ekcoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good to me, happy to see some test coverage added. Two minor comments that I believe can improve the PR slightly.
| ## [Unreleased] | ||
|
|
||
| ### Changed | ||
| - UI toolkit now uses the "UI" action map of project-wide actions as their default input actions. Removing bindings or renaming actions will break UI input for UI toolkit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is expected given the solution we have previously discussed but its unfortunate since the action is basically required (driven by the implementation). In the long run I believe we should consider design changes that would allow the integration to own the action while the editor would allow reconfiguring it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the CHANGED message I believe it could be more clear to users if you added the delta to the description, e.g. "UI toolkit now uses the "UI" action map of project-wide actions as their default input actions instead of..." basically highlighting the switch from hard-coded to customisable.
Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs
Show resolved
Hide resolved
3f15852 to
a79a613
Compare

Description
ISX-1528
Changes made
Change InputSystemProvider for Input For UI module to work with the Project Wide Actions instead of DefaultInputActions. This makes UI TK use project-wide action bindings that can be modified by users.
Added some warnings when the asset is saved with changes to the "UI" action maps. By doing this only in save, it makes sure that other parts of the code are decoupled from Project Wide Actions.
❓
Should there be a way to reset specific action maps? Besides having just "Reset", also have "Reset UI map" and "Reset Player map" as well?Some might prefer to have an Editor UI visual warning (e.g. like a warning icon) when the UI action map is modified. But that would take more time than expected, as it involves UI TK UI changes. Please let me know if there should be any extra effort to change the UI.Notes
ℹ️ The project to be used for QA is specified in the JIRA ticket.
I'll add doc changes in another PR after talking with Ben Pitt.
Checklist
Before review:
Changed,Fixed,Addedsections.([case %number%](https://issuetracker.unity3d.com/issues/...)).Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.