Check for Linux player in DisplayManager

This PR adds a Linux check for the mouse position property so people can use Unity Explorer on Linux at least on the primary monitor until a better solution is found.
Issue describing the bug: https://github.com/sinai-dev/UnityExplorer/issues/167
This commit is contained in:
Qkrisi 2022-08-28 15:34:13 +02:00 committed by GitHub
parent 1e1fb0e27b
commit 819604ce8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ namespace UnityExplorer.UI
public static int Width => ActiveDisplay.renderingWidth; public static int Width => ActiveDisplay.renderingWidth;
public static int Height => ActiveDisplay.renderingHeight; public static int Height => ActiveDisplay.renderingHeight;
public static Vector3 MousePosition => Application.isEditor public static Vector3 MousePosition => Application.isEditor || Application.platform == RuntimePlatform.LinuxPlayer
? InputManager.MousePosition ? InputManager.MousePosition
: Display.RelativeMouseAt(InputManager.MousePosition); : Display.RelativeMouseAt(InputManager.MousePosition);