mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-04 00:23:31 +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 int Height => ActiveDisplay.renderingHeight;
|
||||||
|
|
||||||
public static Vector3 MousePosition => Display.RelativeMouseAt(InputManager.MousePosition);
|
public static Vector3 MousePosition => Display.RelativeMouseAt(InputManager.MousePosition);
|
||||||
|
public static bool MouseInTargetDisplay => MousePosition.z == ActiveDisplayIndex;
|
||||||
|
|
||||||
private static Camera canvasCamera;
|
private static Camera canvasCamera;
|
||||||
|
|
||||||
|
@ -67,6 +67,9 @@ namespace UnityExplorer.UI.Panels
|
|||||||
|
|
||||||
public static void UpdateInstances()
|
public static void UpdateInstances()
|
||||||
{
|
{
|
||||||
|
if (!DisplayManager.MouseInTargetDisplay)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!resizeCursorObj)
|
if (!resizeCursorObj)
|
||||||
CreateCursorUI();
|
CreateCursorUI();
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ namespace UnityExplorer.UI.Panels
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// if the user is clicking
|
// 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;
|
int count = UIManager.PanelHolder.transform.childCount;
|
||||||
var mousePos = DisplayManager.MousePosition;
|
var mousePos = DisplayManager.MousePosition;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user