Optimized the loading method of the setting file

优化了配置文件的加载方式和途径。
This commit is contained in:
hevinci
2022-05-22 00:39:22 +08:00
parent d43d30f72f
commit a906a84721
21 changed files with 146 additions and 255 deletions

View File

@@ -53,12 +53,10 @@ namespace YooAsset.Editor
VisualElement root = rootVisualElement;
// 加载布局文件
var visualAsset = YooAssetEditorSettingsData.Setting.AssetBundleDebuggerUXML;
var visualAsset = EditorHelper.LoadWindowUXML<AssetBundleDebuggerWindow>();
if (visualAsset == null)
{
Debug.LogError($"Not found {nameof(AssetBundleDebuggerWindow)}.uxml in settings.");
return;
}
visualAsset.CloneTree(root);
// 采样按钮

View File

@@ -24,12 +24,10 @@ namespace YooAsset.Editor
public void InitViewer()
{
// 加载布局文件
_visualAsset = YooAssetEditorSettingsData.Setting.DebuggerAssetListViewerUXML;
_visualAsset = EditorHelper.LoadWindowUXML<DebuggerAssetListViewer>();
if (_visualAsset == null)
{
Debug.LogError($"Not found {nameof(DebuggerAssetListViewer)}.uxml in settings.");
return;
}
_root = _visualAsset.CloneTree();
_root.style.flexGrow = 1f;

View File

@@ -24,12 +24,10 @@ namespace YooAsset.Editor
public void InitViewer()
{
// 加载布局文件
_visualAsset = YooAssetEditorSettingsData.Setting.DebuggerBundleListViewerUXML;
_visualAsset = EditorHelper.LoadWindowUXML<DebuggerBundleListViewer>();
if (_visualAsset == null)
{
Debug.LogError($"Not found {nameof(DebuggerBundleListViewer)}.uxml in settings.");
return;
}
_root = _visualAsset.CloneTree();
_root.style.flexGrow = 1f;
@@ -37,12 +35,12 @@ namespace YooAsset.Editor
_bundleListView = _root.Q<ListView>("TopListView");
_bundleListView.makeItem = MakeAssetListViewItem;
_bundleListView.bindItem = BindAssetListViewItem;
#if UNITY_2020_1_OR_NEWER
_bundleListView.onSelectionChange += BundleListView_onSelectionChange;
#else
_bundleListView.onSelectionChanged += BundleListView_onSelectionChange;
#endif
// 使用列表
_usingListView = _root.Q<ListView>("BottomListView");
_usingListView.makeItem = MakeIncludeListViewItem;