public static void ClearCamera(Rect position, Camera camera)
{
Event current = Event.current;
if (camera.targetTexture == null)
{
Rect rect = EditorGUIUtility.PointsToPixels(GUIClip.Unclip(position));
Rect rect2 = new Rect(rect.xMin, Screen.height - rect.yMax, rect.width, rect.height);
camera.pixelRect = rect2;
}
else
{
camera.rect = new Rect(0f, 0f, 1f, 1f);
}
if (current.type == EventType.Repaint)
{
Internal_ClearCamera(camera);
}
else
{
Internal_SetCurrentCamera(camera);
}
}