public override void OnPreviewGUI(Rect position, GUIStyle style)
{
// Fix for case 939947 where we didn't get the Layout event if the texture was null when changing color
if (!ValidPreviewSetup() && Event.current.type != EventType.ExecuteCommand)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
Color prevColor = GUI.color;
GUI.color = new Color(1, 1, 1, 0.5f);
GUILayout.Label("Reflection Probe not baked/ready yet");
GUI.color = prevColor;
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
return;
}
ReflectionProbe p = target as ReflectionProbe;
if (p != null && p.texture != null && targets.Length == 1)
{
Editor editor = m_CubemapEditor;
CreateTextureInspector(p.texture, ref editor);
m_CubemapEditor = editor as TextureInspector;
}
if (m_CubemapEditor != null)
{
m_CubemapEditor.SetCubemapIntensity(GetProbeIntensity((ReflectionProbe)target));
m_CubemapEditor.OnPreviewGUI(position, style);
}
}