// Update is called once per frame void Update() { if (IsMouseDown) { var mouseX = Input.mousePosition.x; var delta = LastX - mouseX; Editor.MovePreview(delta); LastX = mouseX; if (!Input.GetMouseButton(0)) { IsMouseDown = false; } } }
// Update is called once per frame void Update() { if (IsMouseDown) { var mouseX = Input.mousePosition.x; var mouseY = Input.mousePosition.y; var deltaX = LastX - mouseX; var deltaY = LastY - mouseY; Editor.MovePreview(deltaX, -deltaY); LastX = mouseX; LastY = mouseY; if (!Input.GetMouseButton(0)) { IsMouseDown = false; } } }