| | |
| | | using UnityEditor;
|
| | | using System.IO;
|
| | |
|
| | | public class UpdateAllSetting
|
| | | {
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新全部ABLabel(不包括lua)")]
|
| | | public static void SetAllAssetBundleName()
|
| | | {
|
| | | UpdateSpriteSetting.SetAllSpriteAssetBundleName();
|
| | | UpdateUIWindowSetting.SetAllUIWindowAssetBundleName();
|
| | | UpdateUIPrefabSetting.SetAllUIPrefabAssetBundleName();
|
| | | UpdateEffectPrefabSetting.SetAllEffectPrefabAssetBundleName();
|
| | | UpdateMobSetting.SetAllMobAssetBundleName();
|
| | | UpdateShaderSetting.SetAllShaderAssetBundleName();
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | UpdateLevelSetting.SetAllLevelAssetBundleName();
|
| | | UpdateAudioSetting.SetAllAudioAssetBundleName();
|
| | | UpdateVideoSetting.SetAllVideoAssetBundleName();
|
| | | UpdateBuiltInSetting.SetBuiltinAssetBundleName();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("资源包名全部更新完成!");
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateSpriteSetting
|
| | | {
|
| | |
|
| | |
| | | [MenuItem("程序/设置资源包名/更新Sprite(All) AssetBundleName")]
|
| | | public static void SetAllSpriteAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.png", SearchOption.AllDirectories);
|
| | | //改成设置atlas的assetBundleName
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.spriteatlasv2", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + file.Name.Split(".")[0].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.png", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | |
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | |
|
| | | DebugEx.Log("Sprite资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | 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 fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | var importerPath = assetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = StringUtility.Contact("ui/window/", fileNameWithoutExtension);
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = "ui/window";
|
| | |
|
| | | EditorUtility.SetDirty(importer);
|
| | | // 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 fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | var importerPath = assetRelativePath2 + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = StringUtility.Contact("ui/window/", fileNameWithoutExtension);
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = StringUtility.Contact("ui/prioritywindow/", Path.GetFileNameWithoutExtension(path).ToLower());
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | DebugEx.Log("Window资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var importerPath = prefabAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/prefab";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(bossShowRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | |
| | | var importerPath = bossShowAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/bossshow";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(godWeaponRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | |
| | | var importerPath = godWeaponAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/godweapon";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(treasureRootPath).GetFiles("*.prefab", SearchOption.AllDirectories);
|
| | |
| | | var importerPath = treasureAssetRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/treasure/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("Prefab资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | |
|
| | |
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "effect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("Effect资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateMobSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Mob";
|
| | | static string assetPath = "Assets/ResourcesOut/Mob";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Gmodels";
|
| | | static string assetPath = "Assets/ResourcesOut/Gmodels";
|
| | | static string createroleRoot = Application.dataPath + "/ResourcesOut/Gmodels/CreateRole";
|
| | | static string createroleAssetPath = "Assets/ResourcesOut/Gmodels/CreateRole";
|
| | |
|
| | | static string zsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Zs/Materials";
|
| | | static string fsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Fs/Materials";
|
| | |
|
| | | static string zsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Mob/A_Zs/Materials";
|
| | | static string fsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Mob/A_Fs/Materials";
|
| | | static string zsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Gmodels/A_Zs/Materials";
|
| | | static string fsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Gmodels/A_Fs/Materials";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Mob(All) AssetBundleName")]
|
| | | public static void SetAllMobAssetBundleName()
|
| | |
| | | .Replace(".prefab", "")
|
| | | .Replace("Prefab_Hand", "");
|
| | |
|
| | | importer.assetBundleName = StringUtility.Contact("mob/prefab_race", hostfix);
|
| | | EditorUtility.SetDirty(importer);
|
| | | importer.assetBundleName = StringUtility.Contact("gmodels/prefab_race", hostfix);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(createroleRoot).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = createroleAssetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "gmodels/createrole";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | //var zsMaterialFiles = new DirectoryInfo(zsMaterialPath_Origin).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | |
| | | // File.Copy(file.FullName, StringUtility.Contact(fsMaterialPath_OutPut, "/", fileName), true);
|
| | | //}
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | var zsMaterialPathOutFiles = new DirectoryInfo(zsMaterialPath_OutPut).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | foreach (var _file in zsMaterialPathOutFiles)
|
| | | {
|
| | | var _fileName = Path.GetFileName(_file.FullName);
|
| | | var _importerPath = assetPath + "/A_Zs/Materials/" + _file.Name;
|
| | | var _importer = AssetImporter.GetAtPath(_importerPath);
|
| | | if (_file.Name.StartsWith("A_Zs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
|
| | | var fsMaterialPathOutFiles = new DirectoryInfo(fsMaterialPath_OutPut).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | foreach (var _file in fsMaterialPathOutFiles)
|
| | | {
|
| | | var _fileName = Path.GetFileName(_file.FullName);
|
| | | var _importerPath = assetPath + "/A_Fs/Materials/" + _file.Name;
|
| | | var _importer = AssetImporter.GetAtPath(_importerPath);
|
| | | if (_file.Name.StartsWith("A_Fs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
|
| | | //foreach (var file in zsMaterialFiles)
|
| | | //{
|
| | |
| | | // var importerPath = assetPath + "/A_Zs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "mob/a_zs_materials";
|
| | | // importer.assetBundleName = "gmodels/a_zs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | |
|
| | |
| | | // var importerPath = assetPath + "/A_Fs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "mob/a_fs_materials";
|
| | | // importer.assetBundleName = "gmodels/a_fs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | |
|
| | | DebugEx.Log("Gmodels资源包名更新完成!");
|
| | | //AssetDatabase.SaveAssets();
|
| | | //AssetDatabase.Refresh();
|
| | | }
|
| | |
| | | var importerPath = assetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "graphic/shader";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("Shader资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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" };
|
| | | "SoCameraSFX", "SoFlyObject", "SoSkill", "SoSweepHit", "SoGhostShadow", "SoNewBieGuide", "SoMapObjectGenerate","SoDemonDungeon",
|
| | | "SoHazyMapNpc","SoProcessNode"};
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新ScriptableObject(All) AssetBundleName")]
|
| | | public static void SetAllScriptableObjectAssetBundleName()
|
| | |
| | | var importerPath = assetPath + relativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "config/scriptableobjects";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("ScriptableObject资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | 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();
|
| | | EditorUtility.SetDirty(importer);
|
| | | var name = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | if (exportMaps.Contains(name)) //判断这个地图是否被排除,被排除不打包
|
| | | importer.assetBundleName = "";
|
| | | else
|
| | | importer.assetBundleName = "maps/" + name.ToLower();
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | var createRoleAssets = AssetDatabase.FindAssets("t:prefab", new string[] { "Assets/ResourcesOut/Scene/CreateRole" });
|
| | | foreach (var item in createRoleAssets)
|
| | | {
|
| | | var importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(item));
|
| | | importer.assetBundleName = "maps/createrole";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | var textures = AssetDatabase.FindAssets("t:Texture2D", new string[] { "Assets/ResourcesOut/Scene/Textures" });
|
| | |
| | | {
|
| | | var importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(item));
|
| | | importer.assetBundleName = "maps/textures";
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | exportMaps?.Clear();
|
| | | exportMaps = null;
|
| | | DebugEx.Log("map资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | //读取排除地图的配置
|
| | | private static void ReadExportConfig()
|
| | | {
|
| | | if (File.Exists(exportMapsPath))
|
| | | {
|
| | | var lines = File.ReadAllLines(exportMapsPath);
|
| | | exportMaps = new HashSet<string>(lines);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "audio/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("Audio资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateLuaSetting
|
| | | public class UpdateVideoSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Lua/";
|
| | | static string assetPath = "Assets/ResourcesOut/Lua/";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Video/";
|
| | | static string assetPath = "Assets/ResourcesOut/Video/";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Lua(All) AssetBundleName")]
|
| | | public static void SetAllLuaAssetBundleName()
|
| | | [MenuItem("程序/设置资源包名/更新Video(All) AssetBundleName")]
|
| | | public static void SetAllVideoAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.txt", SearchOption.AllDirectories);
|
| | |
|
| | | var amendRootPath = rootPath.Replace("\\", "/");
|
| | | if (!Directory.Exists(rootPath))
|
| | | return;
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.mp4", SearchOption.AllDirectories);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var directoryName = file.DirectoryName.Replace("\\", "/");
|
| | | var relativeDirectory = directoryName.Replace(amendRootPath, "");
|
| | |
|
| | | var importerPath = assetPath + relativeDirectory + Path.DirectorySeparatorChar + file.Name;
|
| | | var importerPath = assetPath + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "lua/" + relativeDirectory.ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | importer.assetBundleName = "video/"+Path.GetFileNameWithoutExtension(file.FullName);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("Video资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | static string assetPath = "Assets/ResourcesOut/BuiltIn/";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新BuiltIn(All) AssetBundleName")]
|
| | | public static void SetAllLuaAssetBundleName()
|
| | | public static void SetBuiltinAssetBundleName()
|
| | | {
|
| | | var allFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(rootPath, allFiles);
|
| | |
| | | if (extension == ".meta")
|
| | | {
|
| | | continue;
|
| | | } |
| | | |
| | | if (extension == ".DS_Store")
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | var directoryName = file.DirectoryName.Replace("\\", "/");
|
| | | var relativeDirectory = directoryName.Replace(amendRootPath, "");
|
| | |
|
| | | var importerPath = assetPath + relativeDirectory + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "builtin/" + relativeDirectory.ToLower();
|
| | | EditorUtility.SetDirty(importer);
|
| | | if (file.Name != ".DS_Store")
|
| | | {
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "builtin/" + relativeDirectory.ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | DebugEx.Log("BuiltIn资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | | } |