| | |
| | | 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);
|
| | | }
|
| | |
| | | // 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()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | }
|
| | | }
|
| | |
|
| | | public class UpdateLuaSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Lua/";
|
| | |
| | | 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);
|