瀏覽代碼

Change mouse position logic

Mouse position past the screen will only be calculated while the left
mouse button is held down.
habeebweeb 4 年之前
父節點
當前提交
aae90d7bc1
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Utility.cs

+ 6 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Utility.cs

@@ -223,14 +223,15 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private void Update()
         {
-            mousePosition.x += Input.GetAxis("Mouse X") * 20;
-            mousePosition.y += Input.GetAxis("Mouse Y") * 20;
-
-            if (Input.GetMouseButtonUp(0) || Input.GetMouseButtonDown(0)) mousePosition = Input.mousePosition;
+            if (Input.GetMouseButton(0))
+            {
+                mousePosition.x += Input.GetAxis("Mouse X") * 20;
+                mousePosition.y += Input.GetAxis("Mouse Y") * 20;
+            }
+            else mousePosition = Input.mousePosition;
         }
     }
 
-
     public static class BinaryExtensions
     {
         public static string ReadNullableString(this BinaryReader binaryReader)