private void DoRenderPreview()
{
GameObject gameObject = this.m_PreviewInstances[this.referenceTargetIndex];
Bounds bounds = new Bounds(gameObject.transform.position, Vector3.zero);
GameObjectInspector.GetRenderableBoundsRecurse(ref bounds, gameObject);
float num = Mathf.Max(bounds.extents.magnitude, 0.0001f);
float num2 = num * 3.8f;
Quaternion quaternion = Quaternion.Euler(-this.previewDir.y, -this.previewDir.x, 0f);
Vector3 position = bounds.center - quaternion * (Vector3.forward * num2);
this.m_PreviewUtility.m_Camera.transform.position = position;
this.m_PreviewUtility.m_Camera.transform.rotation = quaternion;
this.m_PreviewUtility.m_Camera.nearClipPlane = num2 - num * 1.1f;
this.m_PreviewUtility.m_Camera.farClipPlane = num2 + num * 1.1f;
this.m_PreviewUtility.m_Light[0].intensity = 0.7f;
this.m_PreviewUtility.m_Light[0].transform.rotation = quaternion * Quaternion.Euler(40f, 40f, 0f);
this.m_PreviewUtility.m_Light[1].intensity = 0.7f;
this.m_PreviewUtility.m_Light[1].transform.rotation = quaternion * Quaternion.Euler(340f, 218f, 177f);
Color ambient = new Color(0.1f, 0.1f, 0.1f, 0f);
InternalEditorUtility.SetCustomLighting(this.m_PreviewUtility.m_Light, ambient);
bool fog = RenderSettings.fog;
Unsupported.SetRenderSettingsUseFogNoDirty(false);
GameObjectInspector.SetEnabledRecursive(gameObject, true);
this.m_PreviewUtility.m_Camera.Render();
GameObjectInspector.SetEnabledRecursive(gameObject, false);
Unsupported.SetRenderSettingsUseFogNoDirty(fog);
InternalEditorUtility.RemoveCustomLighting();
}