mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2024-12-23 01:59:40 +08:00
Make sure mouse is in target display for resize/dragging/panel operations
This commit is contained in:
parent
96a1cc69fb
commit
97a82c1661
@ -19,6 +19,7 @@ namespace UnityExplorer.UI
|
||||
public static int Height => ActiveDisplay.renderingHeight;
|
||||
|
||||
public static Vector3 MousePosition => Display.RelativeMouseAt(InputManager.MousePosition);
|
||||
public static bool MouseInTargetDisplay => MousePosition.z == ActiveDisplayIndex;
|
||||
|
||||
private static Camera canvasCamera;
|
||||
|
||||
|
@ -67,6 +67,9 @@ namespace UnityExplorer.UI.Panels
|
||||
|
||||
public static void UpdateInstances()
|
||||
{
|
||||
if (!DisplayManager.MouseInTargetDisplay)
|
||||
return;
|
||||
|
||||
if (!resizeCursorObj)
|
||||
CreateCursorUI();
|
||||
|
||||
|
@ -33,7 +33,8 @@ namespace UnityExplorer.UI.Panels
|
||||
return;
|
||||
|
||||
// if the user is clicking
|
||||
if (InputManager.GetMouseButtonDown(0) || InputManager.GetMouseButtonDown(1))
|
||||
if (DisplayManager.MouseInTargetDisplay
|
||||
&& (InputManager.GetMouseButtonDown(0) || InputManager.GetMouseButtonDown(1)))
|
||||
{
|
||||
int count = UIManager.PanelHolder.transform.childCount;
|
||||
var mousePos = DisplayManager.MousePosition;
|
||||
|
Loading…
Reference in New Issue
Block a user