Update asset bundle reporter window

更新构建报告窗口:增加预览AssetBundle文件内容的功能。
This commit is contained in:
hevinci
2022-05-08 21:51:27 +08:00
parent bd87e982ef
commit c22c87e16b
8 changed files with 211 additions and 11 deletions

View File

@@ -42,8 +42,9 @@ namespace YooAsset.Editor
private BundleListReporterViewer _bundleListViewer;
private EViewMode _viewMode;
private string _searchKeyWord;
private BuildReport _buildReport;
private string _reportFilePath;
private string _searchKeyWord;
public void CreateGUI()
@@ -92,6 +93,10 @@ namespace YooAsset.Editor
_viewModeMenu.text = EViewMode.Summary.ToString();
_summaryViewer.AttachParent(root);
}
public void OnDestroy()
{
AssetBundleRecorder.UnloadAll();
}
private void ImportBtn_onClick()
{
@@ -99,19 +104,20 @@ namespace YooAsset.Editor
if (string.IsNullOrEmpty(selectFilePath))
return;
string jsonData = FileUtility.ReadFile(selectFilePath);
_reportFilePath = selectFilePath;
string jsonData = FileUtility.ReadFile(_reportFilePath);
_buildReport = BuildReport.Deserialize(jsonData);
_assetListViewer.FillViewData(_buildReport, _searchKeyWord);
_bundleListViewer.FillViewData(_buildReport, _searchKeyWord);
_bundleListViewer.FillViewData(_buildReport, _reportFilePath, _searchKeyWord);
_summaryViewer.FillViewData(_buildReport);
}
private void OnSearchKeyWordChange(ChangeEvent<string> e)
{
_searchKeyWord = e.newValue;
if(_buildReport != null)
if (_buildReport != null)
{
_assetListViewer.FillViewData(_buildReport, _searchKeyWord);
_bundleListViewer.FillViewData(_buildReport, _searchKeyWord);
_bundleListViewer.FillViewData(_buildReport, _reportFilePath, _searchKeyWord);
}
}
private void ViewModeMenuAction0(DropdownMenuAction action)