diff --git a/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors Roundly.unity b/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors Roundly.unity index 2f8d005..3c95cc3 100644 Binary files a/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors Roundly.unity and b/Assets/uDesktopDuplication/Examples/Scenes/Multiple Monitors Roundly.unity differ diff --git a/Assets/uDesktopDuplication/Scripts/Cursor.cs b/Assets/uDesktopDuplication/Scripts/Cursor.cs index d0ff188..e14ec89 100644 --- a/Assets/uDesktopDuplication/Scripts/Cursor.cs +++ b/Assets/uDesktopDuplication/Scripts/Cursor.cs @@ -14,7 +14,7 @@ public class Cursor : MonoBehaviour private Texture uddTexture_; private Monitor monitor { get { return uddTexture_.monitor; } } - private Dictionary textures_ = new Dictionary(); + private Dictionary textures_ = new Dictionary(); void Start() { @@ -45,14 +45,14 @@ public class Cursor : MonoBehaviour var h = monitor.cursorShapeHeight; if (w == 0 || h == 0) return; - var scale = new Vector2(w, h); - if (!textures_.ContainsKey(scale)) { + var key = w + h * 100; + if (!textures_.ContainsKey(key)) { var texture = new Texture2D(w, h, TextureFormat.BGRA32, false); texture.wrapMode = TextureWrapMode.Clamp; - textures_.Add(scale, texture); + textures_.Add(key, texture); } - var cursorTexture = textures_[scale]; + var cursorTexture = textures_[key]; monitor.GetCursorTexture(cursorTexture.GetNativeTexturePtr()); uddTexture_.material.SetTexture("_CursorTex", cursorTexture); }