// This is the preview area at the bottom of the screen void PreviewArea() { GUI.Box(new Rect(0, m_TopSize, position.width, m_PreviewSize), "", Styles.previewBackground); if (m_ListArea.GetSelection().Length == 0) { return; } EditorWrapper p = null; UnityObject selectedObject = GetCurrentObject(); if (m_PreviewSize < kPreviewExpandedAreaHeight) { // Get info string string s; if (selectedObject != null) { p = m_EditorCache[selectedObject]; string typeName = ObjectNames.NicifyVariableName(selectedObject.GetType().Name); if (p != null) { s = p.name + " (" + typeName + ")"; } else { s = selectedObject.name + " (" + typeName + ")"; } s += " " + AssetDatabase.GetAssetPath(selectedObject); } else { s = "None"; } LinePreview(s, selectedObject, p); } else { if (m_EditorCache == null) { m_EditorCache = new EditorCache(EditorFeatures.PreviewGUI); } // Get info string string s; if (selectedObject != null) { p = m_EditorCache[selectedObject]; string typeName = ObjectNames.NicifyVariableName(selectedObject.GetType().Name); if (p != null) { s = p.GetInfoString(); if (s != "") { s = p.name + "\n" + typeName + "\n" + s; } else { s = p.name + "\n" + typeName; } } else { s = selectedObject.name + "\n" + typeName; } s += "\n" + AssetDatabase.GetAssetPath(selectedObject); } else { s = "None"; } // Make previews if (m_ShowWidePreview.faded != 0.0f) { GUI.color = new Color(1, 1, 1, m_ShowWidePreview.faded); WidePreview(m_PreviewSize, s, selectedObject, p); } if (m_ShowOverlapPreview.faded != 0.0f) { GUI.color = new Color(1, 1, 1, m_ShowOverlapPreview.faded); OverlapPreview(m_PreviewSize, s, selectedObject, p); } GUI.color = Color.white; m_EditorCache.CleanupUntouchedEditors(); } }