| | |
| | |
|
| | | public class UpdateLevelSetting
|
| | | {
|
| | | static string exportMapsPath = Application.dataPath + "/Editor/Config/ExportMaps.txt";
|
| | | static string rootPath = Application.dataPath + "/Art/Maps/Scenes";
|
| | | static string assetPath = "Assets/Art/Maps/Scenes";
|
| | | static HashSet<string> exportMaps;//去除的地图列表
|
| | |
|
| | | public static void SetCreateRoleLevel(string pattern)
|
| | | {
|
| | |
| | | [MenuItem("程序/设置资源包名/更新Level(All) AssetBundleName")]
|
| | | public static void SetAllLevelAssetBundleName()
|
| | | {
|
| | | ReadExportConfig();
|
| | |
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.unity", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = assetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "maps/" + Path.GetFileNameWithoutExtension(file.FullName).ToLower();
|
| | | var name = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | if (exportMaps.Contains(name)) //判断这个地图是否被排除,被排除不打包
|
| | | importer.assetBundleName = "";
|
| | | else
|
| | | importer.assetBundleName = "maps/" + name.ToLower();
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | importer.assetBundleName = "maps/textures";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | exportMaps?.Clear();
|
| | | exportMaps = null;
|
| | | DebugEx.Log("Level资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | | //读取排除地图的配置
|
| | | private static void ReadExportConfig()
|
| | | {
|
| | | if (File.Exists(exportMapsPath))
|
| | | {
|
| | | var lines = File.ReadAllLines(exportMapsPath);
|
| | | exportMaps = new HashSet<string>(lines);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class UpdateAudioSetting
|