NEW: Add extra modes for controlling OnScreenStick origin and movement behaviour#1613
Merged
NEW: Add extra modes for controlling OnScreenStick origin and movement behaviour#1613
Conversation
jimon
reviewed
Dec 16, 2022
| rectTransform.localScale = new Vector3(1, 1, 0); | ||
| rectTransform.anchoredPosition3D = Vector3.zero; | ||
|
|
||
| image.sprite = SpriteUtilities.CreateCircleSprite(16, new Color32(255, 255, 255, 255)); |
Contributor
There was a problem hiding this comment.
Would be useful for users to override this sprite, but because it's only for Behaviour.ExactPositionWithDynamicOrigin it's probably ok for now
jimon
reviewed
Dec 16, 2022
| ### Actions | ||
| - Extended input action code generator (`InputActionCodeGenerator.cs`) to support optional registration and unregistration of callbacks for multiple callback instances via `AddCallbacks(...)` and `RemoveCallbacks(...)` part of the generated code. Contribution by [Ramobo](https://github.com/Ramobo) in [#889](https://github.com/Unity-Technologies/InputSystem/pull/889). | ||
|
|
||
|
|
jimon
approved these changes
Dec 16, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This adds 2 new modes of behaviour for the OnScreenStick.
The existing behaviour, now called
RelativePositionWithStaticOrigin, would not move initially when the user presses the screen, even if that press was not centered on the stick. It would from then on move relatively with the user dragging motion.In addition this PR introduces two new modes:
ExactPositionWithStaticOrigin- allows the stick to react instantly to the initial press, by actuating the control by the amount that the press is offset from the control center.ExactPositionWithDynamicOrigin- allows the stick position to be dynamically set each time the user presses the screen.This is based on the work from this PR contributed by user @eblabs
Changes made
behaviourdynamicOriginRangeproperty to control the screen area whereExactPositionWithDynamicOriginis validChecklist
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.