From a67e179c57c75126d12ad005539097980f3db5e3 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期一, 15 九月 2025 15:32:43 +0800 Subject: [PATCH] 0312 打包不修改代码里的版本号,后续要对版本号进行管理;安卓有对闪图特殊处理后续排查;新资源都放UI目录下 --- Assets/Editor/Tool/UpdateAssetBundleName.cs | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/Editor/Tool/UpdateAssetBundleName.cs b/Assets/Editor/Tool/UpdateAssetBundleName.cs index 8437527..be27dc5 100644 --- a/Assets/Editor/Tool/UpdateAssetBundleName.cs +++ b/Assets/Editor/Tool/UpdateAssetBundleName.cs @@ -54,7 +54,7 @@ { var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + file.Name; var importer = AssetImporter.GetAtPath(importerPath); - importer.assetBundleName = "sprite/" + file.Name.Split(".")[0].ToLower(); + importer.assetBundleName = "ui/sprite/" + file.Name.Split(".")[0].ToLower(); // EditorUtility.SetDirty(importer); } @@ -65,7 +65,7 @@ var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar); var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name; var importer = AssetImporter.GetAtPath(importerPath); - importer.assetBundleName = "sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower(); + importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower(); // EditorUtility.SetDirty(importer); } @@ -95,6 +95,16 @@ // EditorUtility.SetDirty(importer); } + //鎴樻枟棰勫埗浣� + guids = AssetDatabase.FindAssets("t:prefab", new string[] { "Assets/ResourcesOut/Battle/Prefabs" }); + foreach (var guid in guids) + { + var path = AssetDatabase.GUIDToAssetPath(guid); + var importer = AssetImporter.GetAtPath(path); + importer.assetBundleName = "ui/battle/prefabs"; + + // EditorUtility.SetDirty(importer); + } Debug.Log("Window璧勬簮鍖呭悕鏇存柊瀹屾垚!"); // AssetDatabase.SaveAssets(); // AssetDatabase.Refresh(); -- Gitblit v1.8.0