ABPackerInfoManifest.static.cs 765 B

123456789101112131415161718192021222324252627
  1. using XGame.Editor.Asset;
  2. using UnityEditor;
  3. using UnityEngine;
  4. namespace XGame.Editor.Build.AssetBundles
  5. {
  6. public partial class ABPackerInfoManifest
  7. {
  8. public static ABPackerInfoManifest Load()
  9. {
  10. return AssetDatabase.LoadAssetAtPath<ABPackerInfoManifest>(PathDefine.ABPackerManifestPath);
  11. }
  12. internal static void LoadOrCreate()
  13. {
  14. var manifest = Load();
  15. if (manifest == null)
  16. {
  17. manifest = ScriptableObject.CreateInstance<ABPackerInfoManifest>();
  18. AssetDatabase.CreateAsset(manifest, PathDefine.ABPackerManifestPath);
  19. AssetDatabase.SaveAssets();
  20. AssetDatabase.Refresh();
  21. }
  22. }
  23. }
  24. }