diff --git a/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml new file mode 100644 index 0000000..d341c94 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml.meta b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml.meta new file mode 100644 index 0000000..0e313aa --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9052b72c383e95043a0c7e7f369b1ad7 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowserWindow.cs b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowserWindow.cs index 13d11f1..b54eefe 100644 --- a/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowserWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowserWindow.cs @@ -1,11 +1,117 @@ -using System.Collections; +using System.IO; +using System.Linq; using System.Collections.Generic; +using UnityEditor; +using UnityEngine; using UnityEditor.UIElements; +using UnityEngine.UIElements; namespace YooAsset.Editor { - public class AssetBundleBrowserWindow + public class AssetBundleBrowserWindow : EditorWindow { + [MenuItem("YooAsset/AssetBundle Browser", false, 103)] + public static void ShowExample() + { + AssetBundleBrowserWindow wnd = GetWindow(); + wnd.titleContent = new GUIContent("资源包浏览工具"); + wnd.minSize = new Vector2(800, 600); + } + private enum EShowMode + { + AssetList, + BundleList, + } + + private ToolbarMenu _showModeMenu; + private AssetListViewer _assetListViewer; + private BundleListViewer _bundleListViewer; + + private EShowMode _showMode; + private string _searchKeyWord; + private PatchManifest _manifest; + + + public void CreateGUI() + { + VisualElement root = this.rootVisualElement; + + // 加载布局文件 + string uxml = "Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml"; + var visualAsset = AssetDatabase.LoadAssetAtPath(uxml); + if (visualAsset == null) + { + Debug.LogError($"Not found AssetBundleBrowser.uxml : {uxml}"); + return; + } + visualAsset.CloneTree(root); + + // 导入按钮 + var importBtn = root.Q