少年修仙传客户端基础资源
client_Wu Xijin
2019-06-19 782f69cc2cbde229d4861fb0fea5cd7df540160f
3335 更新窗口资源打包策略
1个文件已修改
21 ■■■■■ 已修改文件
Assets/Editor/Tool/UpdateAssetBundleName.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/UpdateAssetBundleName.cs
@@ -46,31 +46,28 @@
public class UpdateUIWindowSetting
{
    static string rootPath = Application.dataPath + "/ResourcesOut/UI/Window";
    static string assetRelativePath = "Assets/ResourcesOut/UI/Window";
    static string rootPath2 = Application.dataPath + "/ResourcesOut/UI/PriorityWindow";
    static string assetRelativePath2 = "Assets/ResourcesOut/UI/PriorityWindow";
    [MenuItem("程序/设置资源包名/更新Window(All) AssetBundleName")]
    public static void SetAllUIWindowAssetBundleName()
    {
        var allFiles = new DirectoryInfo(rootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
        foreach (var file in allFiles)
        var guids = AssetDatabase.FindAssets("t:prefab", new string[] { assetRelativePath });
        foreach (var guid in guids)
        {
            var importerPath = assetRelativePath + Path.DirectorySeparatorChar + file.Name;
            var importer = AssetImporter.GetAtPath(importerPath);
            var path = AssetDatabase.GUIDToAssetPath(guid);
            var importer = AssetImporter.GetAtPath(path);
            importer.assetBundleName = "ui/window";
            EditorUtility.SetDirty(importer);
        }
        allFiles = new DirectoryInfo(rootPath2).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
        foreach (var file in allFiles)
        guids = AssetDatabase.FindAssets("t:prefab", new string[] { assetRelativePath2 });
        foreach (var guid in guids)
        {
            var importerPath = assetRelativePath2 + Path.DirectorySeparatorChar + file.Name;
            var importer = AssetImporter.GetAtPath(importerPath);
            importer.assetBundleName = "ui/prioritywindow";
            var path = AssetDatabase.GUIDToAssetPath(guid);
            var importer = AssetImporter.GetAtPath(path);
            importer.assetBundleName = StringUtility.Contact("ui/prioritywindow/", Path.GetFileNameWithoutExtension(path).ToLower());
            EditorUtility.SetDirty(importer);
        }