static void UpdateDragVector() { worldIntersection = GetCurrentWorldClick(jumpedMousePosition); var worldSpaceMovement = worldIntersection - worldStartPosition; Vector3 tangent; Vector3 biNormal; MathExtensions.CalculateTangents(worldDragPlane.normal, out tangent, out biNormal); var deltaVector = tangent * Vector3.Dot(tangent, worldSpaceMovement) + biNormal * Vector3.Dot(biNormal, worldSpaceMovement); if (UnitySceneExtensions.Snapping.AxisLockX) { deltaVector.x = 0; } if (UnitySceneExtensions.Snapping.AxisLockY) { deltaVector.y = 0; } if (UnitySceneExtensions.Snapping.AxisLockZ) { deltaVector.z = 0; } worldDragDeltaVector = deltaVector; }