From c3771e0399e604e9a2cfe0124f901ed01fcfd7d7 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期四, 09 十月 2025 17:38:11 +0800 Subject: [PATCH] 257 子 【配套功能】新手引导 / 【常规】引导 - 打包 --- Assets/Editor/Tool/UpdateAssetBundleName.cs | 47 ++++++++++++++++++++++------------------------- 1 files changed, 22 insertions(+), 25 deletions(-) diff --git a/Assets/Editor/Tool/UpdateAssetBundleName.cs b/Assets/Editor/Tool/UpdateAssetBundleName.cs index cdf56a2..994190f 100644 --- a/Assets/Editor/Tool/UpdateAssetBundleName.cs +++ b/Assets/Editor/Tool/UpdateAssetBundleName.cs @@ -7,7 +7,7 @@ public class UpdateAllSetting { - [MenuItem("绋嬪簭/璁剧疆璧勬簮鍖呭悕/鏇存柊鍏ㄩ儴ABLabel(涓嶅寘鎷琹ua)")] + [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); + //鏀剧疆鍦╟onfig涓� + importer.assetBundleName = "config/scriptableobject"; + } + } + Debug.Log("ScriptableObject璧勬簮鍖呭悕鏇存柊瀹屾垚! 鏀剧疆鍦╟onfig涓�"); + } } public class UpdateLevelSetting -- Gitblit v1.8.0