Update AssetBundleBrowser

This commit is contained in:
hevinci
2022-03-15 22:30:46 +08:00
parent 6c0fbdae1f
commit d190bc35b4
9 changed files with 47 additions and 37 deletions
@@ -15,19 +15,29 @@ namespace YooAsset.Editor
public static void ShowExample()
{
AssetBundleBrowserWindow wnd = GetWindow<AssetBundleBrowserWindow>();
wnd.titleContent = new GUIContent("栗都관啞응묏야");
wnd.titleContent = new GUIContent("资源包浏览工具");
wnd.minSize = new Vector2(800, 600);
}
/// <summary>
/// 显示模式
/// </summary>
private enum EShowMode
{
/// <summary>
/// 资源对象列表显示模式
/// </summary>
AssetList,
/// <summary>
/// 资源包列表显示模式
/// </summary>
BundleList,
}
private ToolbarMenu _showModeMenu;
private AssetListViewer _assetListViewer;
private BundleListViewer _bundleListViewer;
private AssetListBrowserViewer _assetListViewer;
private BundleListBrowserViewer _bundleListViewer;
private EShowMode _showMode;
private string _searchKeyWord;
@@ -38,7 +48,7 @@ namespace YooAsset.Editor
{
VisualElement root = this.rootVisualElement;
// 속潼꼈애匡숭
// 加载布局文件
string uxml = "Assets/YooAsset/Editor/AssetBundleBrowser/AssetBundleBrowser.uxml";
var visualAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(uxml);
if (visualAsset == null)
@@ -48,28 +58,28 @@ namespace YooAsset.Editor
}
visualAsset.CloneTree(root);
// 돔흙객큐
// 导入按钮
var importBtn = root.Q<Button>("ImportButton");
importBtn.clicked += ImportBtn_onClick;
// 鞫刻친駕꽉데
// 显示模式菜单
_showModeMenu = root.Q<ToolbarMenu>("ShowModeMenu");
_showModeMenu.menu.AppendAction(EShowMode.AssetList.ToString(), ShowModeMenuAction1);
_showModeMenu.menu.AppendAction(EShowMode.BundleList.ToString(), ShowModeMenuAction2);
// 鎧乞으
// 搜索栏
var searchField = root.Q<ToolbarPopupSearchField>("SearchField");
searchField.RegisterValueChangedCallback(OnSearchKeyWordChange);
// 속潼女충
_assetListViewer = new AssetListViewer();
// 加载页面
_assetListViewer = new AssetListBrowserViewer();
_assetListViewer.InitViewer();
// 속潼女충
_bundleListViewer = new BundleListViewer();
// 加载页面
_bundleListViewer = new BundleListBrowserViewer();
_bundleListViewer.InitViewer();
// 놓迦女충
// 初始页面
_showMode = EShowMode.AssetList;
_showModeMenu.text = EShowMode.AssetList.ToString();
_assetListViewer.AttachParent(root);
@@ -77,7 +87,7 @@ namespace YooAsset.Editor
private void ImportBtn_onClick()
{
string selectFilePath = EditorUtility.OpenFilePanel("돔흙껸땀헌데", EditorTools.GetProjectPath(), "bytes");
string selectFilePath = EditorUtility.OpenFilePanel("导入补丁清单", EditorTools.GetProjectPath(), "bytes");
if (string.IsNullOrEmpty(selectFilePath))
return;