You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: android/src/main/kotlin/com/xraph/plugin/flutter_unity_widget/CustomUnityPlayer.kt
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,19 @@ class CustomUnityPlayer(context: Activity, upl: IUnityPlayerLifecycleEvents?) :
46
46
if (event ==null) returnfalse
47
47
48
48
event.source =InputDevice.SOURCE_TOUCHSCREEN
49
-
returnsuper.onTouchEvent(event)
49
+
50
+
// true for Flutter Virtual Display, false for Hybrid composition.
51
+
if (event.deviceId ==0) {
52
+
/*
53
+
Flutter creates a touchscreen motion event with deviceId 0. (https://github.com/flutter/flutter/blob/34b454f42dd6f8721dfe43fc7de5d215705b5e52/packages/flutter/lib/src/services/platform_views.dart#L639)
54
+
Unity's new Input System package does not detect these touches, copy the motion event to change the immutable deviceId.
0 commit comments