三国卡牌客户端基础资源仓库
hch
7 天以前 c3771e0399e604e9a2cfe0124f901ed01fcfd7d7
Assets/Editor/Tool/UpdateAssetBundleName.cs
@@ -7,7 +7,7 @@
public class UpdateAllSetting
{
    [MenuItem("程序/设置资源包名/更新全部ABLabel(不包括lua)")]
    [MenuItem("程序/设置资源包名/更新全部ABLabel")]
    public static void SetAllAssetBundleName()
    {
        UpdateSpriteSetting.SetAllSpriteAssetBundleName();
@@ -20,6 +20,7 @@
        UpdateAudioSetting.SetAllAudioAssetBundleName();
        UpdateVideoSetting.SetAllVideoAssetBundleName();
        UpdateBuiltInSetting.SetBuiltinAssetBundleName();
        UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
        AssetDatabase.Refresh();
        Debug.Log("资源包名全部更新完成!");
    }
@@ -301,32 +302,28 @@
public class UpdateScriptableObjectsSetting
{
    // static string rootPath = Application.dataPath + "/ResourcesOut/Refdata/ScriptableObject/";
    // static string assetPath = "Assets/ResourcesOut/Refdata/ScriptableObject/";
    // static string[] relativePaths = new string[] { "SoTreasure3D", "SoTreasureMeridian", "SoActor", "SoDeadFly", "SoBodyControl",
    //     "SoCameraSFX", "SoFlyObject", "SoSkill", "SoSweepHit", "SoGhostShadow", "SoNewBieGuide", "SoMapObjectGenerate","SoDemonDungeon",
    //     "SoHazyMapNpc","SoProcessNode"};
    static string rootPath = Application.dataPath + "/ResourcesOut/ScriptableObject/";
    static string assetPath = "Assets/ResourcesOut/ScriptableObject/";
    static string[] relativePaths = new string[] { "NewBieGuide"};
    // [MenuItem("程序/设置资源包名/更新ScriptableObject(All) AssetBundleName")]
    // public static void SetAllScriptableObjectAssetBundleName()
    // {
    //     for (int i = 0; i < relativePaths.Length; i++)
    //     {
    //         var relativePath = relativePaths[i];
    //         var allFiles = new DirectoryInfo(rootPath + relativePath).GetFiles("*.asset", SearchOption.TopDirectoryOnly);
    [MenuItem("程序/设置资源包名/更新ScriptableObject(All) AssetBundleName")]
    public static void SetAllScriptableObjectAssetBundleName()
    {
        for (int i = 0; i < relativePaths.Length; i++)
        {
            var relativePath = relativePaths[i];
            var allFiles = new DirectoryInfo(rootPath + relativePath).GetFiles("*.asset", SearchOption.TopDirectoryOnly);
    //         foreach (var file in allFiles)
    //         {
    //             var importerPath = assetPath + relativePath + Path.DirectorySeparatorChar + file.Name;
    //             var importer = AssetImporter.GetAtPath(importerPath);
    //             importer.assetBundleName = "config/scriptableobjects";
    //             // EditorUtility.SetDirty(importer);
    //         }
    //     }
    //     Debug.Log("ScriptableObject资源包名更新完成!");
    //     // AssetDatabase.SaveAssets();
    //     // AssetDatabase.Refresh();
    // }
            foreach (var file in allFiles)
            {
                var importerPath = assetPath + relativePath + Path.DirectorySeparatorChar + file.Name;
                var importer = AssetImporter.GetAtPath(importerPath);
                //放置在config下
                importer.assetBundleName = "config/scriptableobject";
            }
        }
        Debug.Log("ScriptableObject资源包名更新完成! 放置在config下");
    }
}
public class UpdateLevelSetting