-
Notifications
You must be signed in to change notification settings - Fork 316
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
FIX: Fixed multiple OnScreenStick
Components that does not work together when using them simultaneously in isolation mode (ISXB-813)
#2090
base: develop
Are you sure you want to change the base?
Conversation
… when using them simultaneously in isolation mode.
Debug.Assert(EventSystem.current != null); | ||
|
||
var screenPosition = Vector2.zero; | ||
if (ctx.control?.device is Pointer pointer) | ||
TouchControl touchControl = null; | ||
if (ctx.control?.parent is TouchControl touch) |
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.
Unfortunately this is the design, generally this is a perfect fit for a device-agnostic pointer interface (just a side note)
|
||
var screenPosition = ((Pointer)ctx.control.device).position.ReadValue(); | ||
// If it's a finger take the value from the finger that initiated the change |
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.
More a general conceptual thought around the scalability of this than the particular fix, what if the on screen control is interacted with a pen?
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.
good question I don't have a pen/touch setup to test.
But we can fix the pen case after if needed. Here it only fix when it comes from a touch device
@@ -430,6 +481,10 @@ public bool useIsolatedInputActions | |||
private List<RaycastResult> m_RaycastResults; | |||
[NonSerialized] | |||
private PointerEventData m_PointerEventData; | |||
[NonSerialized] | |||
private TouchControl m_TouchControl; |
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.
Not really related to this fix, but more to the original design, this implies that a member would need to be added for any kind of pointer device right? Or is this particularly due to TouchControl not being a derivative of pointer in your opinion @bmalrat ?
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.
Normally we don't need it for each type, only for touch to identify which one was touched in the /touch*/press. I'm not aware of an other type that could aggregate multiple source into one 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.
Checked touch controls using the user project as well as the standard touch control project we use for release testing, did not notice any issues
Description
When multiple OnScreenStick is used at the same time, in isolation mode, it doesn't distinguish which finger drive the components and will be not functional.
To fix that I added, when it come from a touch event a track of which finger triggered it and only use information from it.
I also switched the pointerdown tracking to bypass to be able to track any pointer down/up instead of only the First down and last Up.
Testing status & QA
Added tests
tested on android with the customer project.
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the 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: