Skip to content

Commit c69fbda

Browse files
committed
Fixes Touch.AddFingers allowing creating of invalid Finger
Since the fast enter playmode PR, SubSystemRegistration ordering issue is causing errors on mobile device when using ISX with AppUI. The issue was causing a benign exception in development build.
1 parent 478db47 commit c69fbda

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • Packages/com.unity.inputsystem/InputSystem/Runtime/Plugins/EnhancedTouch

Packages/com.unity.inputsystem/InputSystem/Runtime/Plugins/EnhancedTouch/Touch.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,14 @@ internal struct FingerAndTouchState
772772

773773
public void AddFingers(Touchscreen screen)
774774
{
775+
// The global touch state may have been reset after EnhancedTouchSupport.Enable() subscribed to device changes.
776+
// A device added through that stale subscription would build a Finger with a None mask, which InputStateHistory.updateMask rejects.
777+
// Skip until the state is set up again.
778+
if (updateMask == InputUpdateType.None)
779+
{
780+
return;
781+
}
782+
775783
var touchCount = screen.touches.Count;
776784
ArrayHelpers.EnsureCapacity(ref fingers, totalFingerCount, touchCount);
777785
for (var i = 0; i < touchCount; ++i)

0 commit comments

Comments
 (0)