-
Notifications
You must be signed in to change notification settings - Fork 322
DOCS: How to use processors #2171
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
base: develop
Are you sure you want to change the base?
Conversation
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 did my first pass on the PR. Please fix the note formatting and replace the placeholder image alt text with something more descriptive. Also, there are quite a few sentences written in passive voice—please rewrite them in active voice where appropriate. You can refer to the Unity style guide for reference: https://docs-style-guide.unity.com/style/use-active-voice.
Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
|
||
 | ||
|
||
Note that the Bindings can contain input values with very different ranges. In that case, a Scale Processor on the Bindings can help preprocess the values before clamping them (Processors on Actions are applied after Processors on Bindings). |
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 that case, a Scale Processor on the Bindings can help preprocess the values before clamping them (Processors on Actions are applied after Processors on Bindings).
I think it would be good to have an example or expand an existing one to show examples of order of execution of processors. Always better to have an example than saying it in words IMO.
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.
Do you have a specific example in mind?
…sors.md Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
…sors.md Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
…sors.md Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #2171 +/- ##
===========================================
+ Coverage 67.78% 67.80% +0.02%
===========================================
Files 367 367
Lines 53505 53505
===========================================
+ Hits 36268 36280 +12
+ Misses 17237 17225 -12
Flags with carried forward coverage won't be shown. Click here to find out more. see 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Finished my review with some suggestions.
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
Outdated
Show resolved
Hide resolved
Co-authored-by: lilisha-unity <94024889+lilisha-unity@users.noreply.github.com>
…es/InputSystem into docs-processors
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 to me, added some minor comments
|
||
## Processors on Bindings | ||
|
||
When you create Bindings for your [actions](Actions.md), you can choose to add Processors to the Bindings. These process the values from the controls they bind to, before the system applies them to the Action value. For instance, you might want to invert the `Vector2` values from the controls along the Y axis before passing these values to the Action that drives the input logic for your application. To do this, you can add an [Invert Vector2](ProcessorTypes.md#invert-vector-2) Processor to your Binding. |
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.
Minor: Y-axis?
|
||
If you're using Actions defined in the [Input Actions Editor](ActionsEditor.md), or in an [Action Asset](ActionAssets.md), you can add any Processor to your Bindings in the Input Action editor: | ||
|
||
1. Select the Binding you want to add Processors to so that the right pane of the window displays the properties for that Binding. |
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.
Minor: "right pane" or "right panel"? Maybe call it by its UI title instead?
|
||
The [Clamp Processor](ProcessorTypes.md#clamp) clamps the input value to a specified range. The minimum value of the Processor defines the lowest input value that will be accepted, while the value cannot exceed the given maximum value. In combination with the Scale Processor, it is easy to standardize the input value ranges of different devices and place them within a well-defined value spectrum. | ||
|
||
#### Example: Racing game speend control |
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.
Typo: "speed"
|
||
#### Example: Racing game speend control | ||
|
||
In a case where the player is not supposed to fall below a certain base speed, but also cannot exceed a certain maximum speed, the Clamp Processor is the one you may want to use. |
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.
Generally, IMO this to be game-logic and not input logic, but its fine as-is to show as example.
Looks like there is some CI issues that needs attention |
Description
This adds more documentation on how to use processors.
Testing status & QA
No testing
Overall Product Risks
Comments to reviewers
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: