Skip to content

Commit b7ca22b

Browse files
committed
fix a hit test probelm after recovering from sleep
1 parent 706f5f2 commit b7ca22b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/Scripts/Core/Container.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ public DisplayObject HitTest(Vector2 stagePoint, bool forTouch)
517517
if (Display.displays.Length > 1)
518518
{
519519
Vector3 p = Display.RelativeMouseAt(HitTestContext.screenPoint);
520-
if (p != Vector3.zero)
520+
if (p.x != 0 || p.y != 0) //(p != Vector3.zero) we got (0,0,1) in some unity version, especially on recovering from sleep
521521
HitTestContext.screenPoint = p;
522522
}
523523
HitTestContext.worldPoint = StageCamera.main.ScreenToWorldPoint(HitTestContext.screenPoint);

0 commit comments

Comments
 (0)