private static void HandleMouseDrag(SceneView view, int id)
{
s_Dragged = true;
if (GUIUtility.hotControl != id)
{
return;
}
Event current = Event.current;
switch (Tools.s_LockedViewTool)
{
case ViewTool.Orbit:
if (!view.in2DMode && !view.isRotationLocked)
{
OrbitCameraBehavior(view);
view.svRot.UpdateGizmoLabel(view, (Vector3) (view.rotation * Vector3.forward), view.m_Ortho.target);
}
goto Label_031E;
case ViewTool.Pan:
{
view.viewIsLockedToObject = false;
view.FixNegativeSize();
Vector3 position = view.camera.WorldToScreenPoint(view.pivot) + new Vector3(-Event.current.delta.x, Event.current.delta.y, 0f);
Vector3 vector7 = Camera.current.ScreenToWorldPoint(position) - view.pivot;
vector7 = (Vector3) (vector7 * EditorGUIUtility.pixelsPerPoint);
if (current.shift)
{
vector7 = (Vector3) (vector7 * 4f);
}
view.pivot += vector7;
goto Label_031E;
}
case ViewTool.Zoom:
{
float num = HandleUtility.niceMouseDeltaZoom * (!current.shift ? ((float) 3) : ((float) 9));
if (!view.orthographic)
{
s_TotalMotion += num;
if (s_TotalMotion < 0f)
{
view.size = s_StartZoom * (1f + (s_TotalMotion * 0.001f));
}
else
{
view.size += (num * s_ZoomSpeed) * 0.003f;
}
}
else
{
view.size = Mathf.Max((float) 0.0001f, (float) (view.size * (1f + (num * 0.001f))));
}
goto Label_031E;
}
case ViewTool.FPS:
{
if (view.in2DMode || view.isRotationLocked)
{
goto Label_031E;
}
if (view.orthographic)
{
OrbitCameraBehavior(view);
break;
}
view.viewIsLockedToObject = false;
Vector3 vector = view.pivot - ((Vector3) ((view.rotation * Vector3.forward) * view.cameraDistance));
Quaternion rotation = view.rotation;
rotation = Quaternion.AngleAxis((current.delta.y * 0.003f) * 57.29578f, (Vector3) (rotation * Vector3.right)) * rotation;
rotation = Quaternion.AngleAxis((current.delta.x * 0.003f) * 57.29578f, Vector3.up) * rotation;
view.rotation = rotation;
view.pivot = vector + ((Vector3) ((rotation * Vector3.forward) * view.cameraDistance));
break;
}
default:
Debug.Log("Enum value Tools.s_LockViewTool not handled");
goto Label_031E;
}
view.svRot.UpdateGizmoLabel(view, (Vector3) (view.rotation * Vector3.forward), view.m_Ortho.target);
Label_031E:
current.Use();
}