Optimized the loading method of the setting file

优化了配置文件的加载方式和途径。
This commit is contained in:
hevinci
2022-05-13 23:53:19 +08:00
parent a054740de6
commit 8dc0560537
38 changed files with 308 additions and 265 deletions
@@ -9,7 +9,7 @@ using UnityEngine.UIElements;
namespace YooAsset.Editor
{
internal class AssetListReporterViewer
internal class ReporterAssetListViewer
{
private enum ESortMode
{
@@ -38,12 +38,10 @@ namespace YooAsset.Editor
public void InitViewer()
{
// 加载布局文件
string rootPath = EditorTools.GetYooAssetSourcePath();
string uxml = $"{rootPath}/Editor/AssetBundleReporter/VisualViewers/{nameof(AssetListReporterViewer)}.uxml";
_visualAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(uxml);
_visualAsset = YooAssetEditorSettingsData.Setting.ReporterAssetListViewerUXML;
if (_visualAsset == null)
{
Debug.LogError($"Not found {nameof(AssetListReporterViewer)}.uxml : {uxml}");
Debug.LogError($"Not found {nameof(ReporterAssetListViewer)}.uxml in settings.");
return;
}
@@ -10,7 +10,7 @@ using UnityEngine.UIElements;
namespace YooAsset.Editor
{
internal class BundleListReporterViewer
internal class ReporterBundleListViewer
{
private enum ESortMode
{
@@ -42,12 +42,10 @@ namespace YooAsset.Editor
public void InitViewer()
{
// 加载布局文件
string rootPath = EditorTools.GetYooAssetSourcePath();
string uxml = $"{rootPath}/Editor/AssetBundleReporter/VisualViewers/{nameof(BundleListReporterViewer)}.uxml";
_visualAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(uxml);
_visualAsset = YooAssetEditorSettingsData.Setting.ReporterBundleListViewerUXML;
if (_visualAsset == null)
{
Debug.LogError($"Not found {nameof(BundleListReporterViewer)}.uxml : {uxml}");
Debug.LogError($"Not found {nameof(ReporterBundleListViewer)}.uxml in settings.");
return;
}
@@ -9,7 +9,7 @@ using UnityEngine.UIElements;
namespace YooAsset.Editor
{
internal class SummaryReporterViewer
internal class ReporterSummaryViewer
{
private class ItemWrapper
{
@@ -37,12 +37,10 @@ namespace YooAsset.Editor
public void InitViewer()
{
// 加载布局文件
string rootPath = EditorTools.GetYooAssetSourcePath();
string uxml = $"{rootPath}/Editor/AssetBundleReporter/VisualViewers/{nameof(SummaryReporterViewer)}.uxml";
_visualAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(uxml);
_visualAsset = YooAssetEditorSettingsData.Setting.ReporterSummaryViewerUXML;
if (_visualAsset == null)
{
Debug.LogError($"Not found {nameof(SummaryReporterViewer)}.uxml : {uxml}");
Debug.LogError($"Not found {nameof(ReporterSummaryViewer)}.uxml in settings.");
return;
}
_root = _visualAsset.CloneTree();