Example #1
0
 public static GUIContent ObjectContent(UnityEngine.Object obj, Type type)
 {
     if (obj)
     {
         EditorGUIUtility.s_ObjectContent.text  = EditorGUIUtility.GetObjectNameWithInfo(obj);
         EditorGUIUtility.s_ObjectContent.image = AssetPreview.GetMiniThumbnail(obj);
     }
     else if (type != null)
     {
         EditorGUIUtility.s_ObjectContent.text  = EditorGUIUtility.GetTypeNameWithInfo(type.Name);
         EditorGUIUtility.s_ObjectContent.image = AssetPreview.GetMiniTypeThumbnail(type);
     }
     else
     {
         EditorGUIUtility.s_ObjectContent.text  = "<no type>";
         EditorGUIUtility.s_ObjectContent.image = null;
     }
     return(EditorGUIUtility.s_ObjectContent);
 }