void DrawFoldout(ResourceDetail rd) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal(GUILayout.Width(wnd.position.width * (1 - 0.618f))); EditorGUILayout.LabelField(new GUIContent(AssetDatabase.GetCachedIcon(rd.resources[0].path)), new GUILayoutOption[] { GUILayout.Width(30), GUILayout.Height(20) }); rd.isOpen = EditorGUILayout.Foldout(rd.isOpen, rd.resources[0].name); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true)); ResUtils.ColorLabel(Title_Error, rd.errorNum.ToString(), rd.errorNum == 0 ? 0 : 2); ResUtils.ColorLabel(Title_Warning, rd.warnNum.ToString(), rd.warnNum < 1 ? 0 : 1); ResUtils.ColorLabel(Title_Repeat, rd.resources.Count.ToString(), rd.resources.Count <= 1 ? 0 : 2); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndHorizontal(); }
void DrawFoldoutContent(ResourceDetail rd) { if (rd.isOpen) { DrawFoldout(rd); //EditorGUI.BeginDisabledGroup(true); for (int i = 0; i < rd.resources.Count; i++) { EditorGUI.indentLevel += 2; var res = rd.resources[i]; EditorGUILayout.ObjectField("", res.resObj, typeof(Object), false); EditorGUI.indentLevel++; res.OnResourceGUI(); EditorGUI.indentLevel--; res.isUsedOpen = EditorGUILayout.Foldout(res.isUsedOpen, Title_Reference); if (res.isUsedOpen) { string[] _TempArray = ResUtils.GetUseAssetPaths(res.path, allAssetsPaths); EditorGUI.indentLevel++; for (int j = 0; j < _TempArray.Length; j++) { Object obj = AssetDatabase.LoadAssetAtPath(_TempArray[j], typeof(Object)); if (!AssetDatabase.IsSubAsset(obj)) {//排除FBX 内部引用 EditorGUILayout.BeginHorizontal(); //EditorGUILayout.LabelField("", td.md5); EditorGUILayout.ObjectField("", obj, typeof(Object), false); //EditorGUILayout.LabelField("",tr.hashCode.ToString()); EditorGUILayout.EndHorizontal(); } } EditorGUI.indentLevel--; } EditorGUI.indentLevel -= 2; } //EditorGUI.EndDisabledGroup(); } else { DrawFoldout(rd); } }