Skip to content

Commit

Permalink
fix a hit test probelm after recovering from sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguzhu committed Apr 21, 2024
1 parent 706f5f2 commit b7ca22b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Scripts/Core/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public DisplayObject HitTest(Vector2 stagePoint, bool forTouch)
if (Display.displays.Length > 1)
{
Vector3 p = Display.RelativeMouseAt(HitTestContext.screenPoint);
if (p != Vector3.zero)
if (p.x != 0 || p.y != 0) //(p != Vector3.zero) we got (0,0,1) in some unity version, especially on recovering from sleep
HitTestContext.screenPoint = p;
}
HitTestContext.worldPoint = StageCamera.main.ScreenToWorldPoint(HitTestContext.screenPoint);
Expand Down

0 comments on commit b7ca22b

Please sign in to comment.