using System.Collections.Generic; using UnityEditor; using UnityEngine; using System.IO; namespace MetaCity.BundleKit.Editor { public static class SpawnPositionCollector { public static void CollectSpawnPositionBundle(List tasks) { var assetPath = Constants.SpawnPositionConfigPath; var config = AssetDatabase.LoadAssetAtPath(assetPath); if (!config) { Debug.LogError("no spawn position configuration file found!"); return; } var jsonData = JsonUtility.ToJson(config); var jsonPath = Constants.SpawnPositionJsonPath; File.WriteAllText(jsonPath, jsonData); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); var builder = Utilities.CreateSpawnPositionBundleBuild("Assets/spawnPositionConfig.json"); tasks.Add(new MetacityBundle { BundleBuild = builder, BundleType = MetacityBundleType.SpawnPoints, NeedUpload = true }); } } }