From b7ca22bd13700873669ce0356feb4bb3abcae523 Mon Sep 17 00:00:00 2001 From: "guzhu@fairygui.com" Date: Sun, 21 Apr 2024 14:43:32 +0800 Subject: [PATCH] fix a hit test probelm after recovering from sleep --- Assets/Scripts/Core/Container.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Core/Container.cs b/Assets/Scripts/Core/Container.cs index 47e5da46..385c34f3 100644 --- a/Assets/Scripts/Core/Container.cs +++ b/Assets/Scripts/Core/Container.cs @@ -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);