mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-11 01:48:07 +08:00
Make sure mouse is in target display for resize/dragging/panel operations
This commit is contained in:
1 parent
96a1cc69fb
commit
97a82c1661
3 files changed
+6
-1
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user