protected void OnGUI() { EZEditorGUIUtility.WindowTitle(this); showAssets = (AssetsViewOption)EditorGUILayout.EnumPopup("Show Assets", showAssets); showDependencies = (BundleDependenciesViewOption)EditorGUILayout.EnumPopup("Show Dependencies", showDependencies); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); DrawAssetBundleManager(showAssets, showDependencies); EditorGUILayout.EndScrollView(); }
protected override void OnGUI() { base.OnGUI(); showAssets = (AssetsViewOption)EditorGUILayout.EnumPopup("Show Assets", showAssets); showDependencies = (BundleDependenciesViewOption)EditorGUILayout.EnumPopup("Show Dependencies", showDependencies); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); DrawAssetBundleManager(showAssets, showDependencies); EditorGUILayout.EndScrollView(); }
public static void DrawAssetBundleManager(AssetsViewOption showAssets, BundleDependenciesViewOption showDependencies) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Refresh")) { Refresh(); } if (GUILayout.Button("Remove Unused AssetBundleNames")) { AssetDatabase.RemoveUnusedAssetBundleNames(); Refresh(); } EditorGUILayout.EndHorizontal(); foreach (BundleInfo bundleInfo in bundleList) { EditorGUILayout.LabelField(bundleInfo.bundleName); EditorGUI.indentLevel++; switch (showAssets) { case AssetsViewOption.Object: DrawAssetCollection("", bundleInfo.assetObjects); break; case AssetsViewOption.Path: DrawStringCollection("", bundleInfo.assetPaths); break; case AssetsViewOption.PathAndObject: DrawAssetList("", bundleInfo.assetPaths, bundleInfo.assetObjects); break; } switch (showDependencies) { case BundleDependenciesViewOption.DontShow: break; case BundleDependenciesViewOption.Direct: DrawStringCollection("Dependencies", bundleInfo.dependencies); break; case BundleDependenciesViewOption.Recursive: DrawStringCollection("Dependencies", bundleInfo.recursiveDependencies); break; } EditorGUI.indentLevel--; } }