123456789101112131415161718192021222324252627282930313233343536373839 |
- using XGame.Editor.Asset;
- using UnityEditor;
- using UnityEngine;
- namespace XGame.Editor.Build.AssetBundles
- {
- /// <summary>
- /// 备份用Manifest文件
- /// </summary>
- public class AssetBundleBackupManifest : ScriptableObject
- {
- #region static
- public static string ManifestPath => $"{PathDefine.ConfigsRelative}AssetBundleBackupManifest.asset";
- public static AssetBundleBackupManifest Load()
- {
- return AssetDatabase.LoadAssetAtPath<AssetBundleBackupManifest>(ManifestPath);
- }
- public static void Save(AssetBundleBackupInfo[] backupInfos, bool refresh)
- {
- var manifest = Load();
- if (manifest == null)
- {
- manifest = ScriptableObject.CreateInstance<AssetBundleBackupManifest>();
- AssetDatabase.CreateAsset(manifest, ManifestPath);
- }
- manifest.bundleInfos = backupInfos;
- EditorUtility.SetDirty(manifest);
- if (refresh)
- {
- AssetDatabase.SaveAssets();
- AssetDatabase.Refresh();
- }
- }
- #endregion
- public AssetBundleBackupInfo[] bundleInfos;
- }
- }
|