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

View File

@@ -105,22 +105,7 @@ namespace YooAsset.Editor
/// </summary>
private static void LoadSettingData()
{
// 加载配置文件
string settingFilePath = $"{EditorTools.GetYooAssetSettingPath()}/{nameof(AssetBundleCollectorSetting)}.asset";
_setting = AssetDatabase.LoadAssetAtPath<AssetBundleCollectorSetting>(settingFilePath);
if (_setting == null)
{
Debug.LogWarning($"Create new {nameof(AssetBundleCollectorSetting)}.asset : {settingFilePath}");
_setting = ScriptableObject.CreateInstance<AssetBundleCollectorSetting>();
EditorTools.CreateFileDirectory(settingFilePath);
AssetDatabase.CreateAsset(Setting, settingFilePath);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
else
{
Debug.Log($"Load {nameof(AssetBundleCollectorSetting)}.asset ok");
}
_setting = YooAssetEditorSettingsHelper.LoadSettingData<AssetBundleCollectorSetting>();
// IPackRule
{