| | |
| | | using UnityEditor;
|
| | | using System.IO;
|
| | |
|
| | | public class UpdateAllSetting
|
| | | {
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新全部AssetBundleName")]
|
| | | public static void SetAllAssetBundleName()
|
| | | { |
| | | UpdateSpriteSetting.SetAllSpriteAssetBundleName();
|
| | | UpdateUIWindowSetting.SetAllUIWindowAssetBundleName();
|
| | | UpdateUIPrefabSetting.SetAllUIPrefabAssetBundleName();
|
| | | UpdateEffectPrefabSetting.SetAllEffectPrefabAssetBundleName();
|
| | | UpdateMobSetting.SetAllMobAssetBundleName();
|
| | | UpdateShaderSetting.SetAllShaderAssetBundleName();
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | UpdateLevelSetting.SetAllLevelAssetBundleName();
|
| | | UpdateAudioSetting.SetAllAudioAssetBundleName();
|
| | | UpdateVideoSetting.SetAllVideoAssetBundleName();
|
| | | UpdateLuaSetting.SetAllLuaAssetBundleName();
|
| | | UpdateBuiltInSetting.SetBuiltinAssetBundleName();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateSpriteSetting
|
| | | {
|
| | |
|
| | |
| | |
|
| | | 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);
|
| | | }
|
| | |
| | |
|
| | | public class UpdateUIPrefabSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UI/Prefab";
|
| | | static string assetRelativePath = "Assets/ResourcesOut/UI/Prefab";
|
| | | static string prefabRootPath = Application.dataPath + "/ResourcesOut/UI/Prefab";
|
| | | static string prefabAssetRelativePath = "Assets/ResourcesOut/UI/Prefab";
|
| | |
|
| | | static string bossShowRootPath = Application.dataPath + "/ResourcesOut/UI/BossShow";
|
| | | static string bossShowAssetRelativePath = "Assets/ResourcesOut/UI/BossShow";
|
| | |
|
| | | static string godWeaponRootPath = Application.dataPath + "/ResourcesOut/UI/GodWeapon";
|
| | | static string godWeaponAssetRelativePath = "Assets/ResourcesOut/UI/GodWeapon";
|
| | |
|
| | | static string treasureRootPath = Application.dataPath + "/ResourcesOut/UI/Treasure";
|
| | | static string treasureAssetRelativePath = "Assets/ResourcesOut/UI/Treasure";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Prefab(All) AssetBundleName")]
|
| | | public static void SetAllUIPrefabAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | |
|
| | | var allFiles = new DirectoryInfo(prefabRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = assetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importerPath = prefabAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/prefab";
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(bossShowRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = bossShowAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/bossshow";
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(godWeaponRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = godWeaponAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/godweapon";
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(treasureRootPath).GetFiles("*.prefab", SearchOption.AllDirectories);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
|
| | | 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);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | public class UpdateEffectPrefabSetting
|
| | |
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Mob";
|
| | | static string assetPath = "Assets/ResourcesOut/Mob";
|
| | | static string createroleRoot = Application.dataPath + "/ResourcesOut/Mob/CreateRole";
|
| | | static string createroleAssetPath = "Assets/ResourcesOut/Mob/CreateRole";
|
| | |
|
| | | static string zsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Zs/Materials";
|
| | | static string fsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Fs/Materials";
|
| | |
|
| | |
| | | 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 = "mob/createrole";
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | //var zsMaterialFiles = new DirectoryInfo(zsMaterialPath_Origin).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | //if (!Directory.Exists(zsMaterialPath_OutPut))
|
| | | //{
|
| | |
| | | // var fileName = Path.GetFileName(file.FullName);
|
| | | // File.Copy(file.FullName, StringUtility.Contact(fsMaterialPath_OutPut, "/", fileName), true);
|
| | | //}
|
| | |
|
| | | 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 = "mob/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/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 = "mob/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | }
|
| | | EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
|
| | | 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()
|
| | |
| | | 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" });
|
| | | foreach (var item in textures)
|
| | | {
|
| | |
| | | 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);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateVideoSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Video/";
|
| | | static string assetPath = "Assets/ResourcesOut/Video/";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Video(All) AssetBundleName")]
|
| | | public static void SetAllVideoAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.mp4", SearchOption.AllDirectories);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = assetPath + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "video/mp4";
|
| | | EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | 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);
|