您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
32 行
1.2 KiB
32 行
1.2 KiB
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using System.IO;
|
|
namespace MetaCity.BundleKit.Editor
|
|
{
|
|
public static class SpawnPositionCollector
|
|
{
|
|
public static void CollectSpawnPositionBundle(List<MetacityBundle> tasks)
|
|
{
|
|
var assetPath = Constants.SpawnPositionConfigPath;
|
|
var config = AssetDatabase.LoadAssetAtPath<SpawnPositionConfig>(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
|
|
});
|
|
}
|
|
}
|
|
}
|