| | |
| | | UpdateEffectPrefabSetting.SetAllEffectPrefabAssetBundleName();
|
| | | UpdateMobSetting.SetAllMobAssetBundleName();
|
| | | UpdateShaderSetting.SetAllShaderAssetBundleName();
|
| | | UpdateScriptableObjectsSetting.SetAllScriptableObjectAssetBundleName();
|
| | | UpdateLevelSetting.SetAllLevelAssetBundleName();
|
| | | UpdateAudioSetting.SetAllAudioAssetBundleName();
|
| | | UpdateVideoSetting.SetAllVideoAssetBundleName();
|
| | |
| | |
|
| | | public static void SetRechargeSkin(int pattern)
|
| | | {
|
| | | var toDirectory = Application.dataPath + "/ResourcesOut/Sprite/Recharge";
|
| | | var oldFiles = new DirectoryInfo(toDirectory).GetFiles("*.png", SearchOption.AllDirectories);
|
| | | foreach (var item in oldFiles)
|
| | | {
|
| | | File.Delete(item.FullName);
|
| | | }
|
| | | // var toDirectory = Application.dataPath + "/ResourcesOut/Sprite/Recharge";
|
| | | // var oldFiles = new DirectoryInfo(toDirectory).GetFiles("*.png", SearchOption.AllDirectories);
|
| | | // foreach (var item in oldFiles)
|
| | | // {
|
| | | // File.Delete(item.FullName);
|
| | | // }
|
| | |
|
| | | var fromDirectory = Application.dataPath + "/Editor/RechargeSprites/Pattern_" + pattern;
|
| | | FileExtersion.DirectoryCopy(fromDirectory, toDirectory);
|
| | | // var fromDirectory = Application.dataPath + "/Editor/RechargeSprites/Pattern_" + pattern;
|
| | | // FileExtersion.DirectoryCopy(fromDirectory, toDirectory);
|
| | | }
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Sprite(All) AssetBundleName")]
|
| | |
| | |
|
| | | public class UpdateEffectPrefabSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Effect/";
|
| | | static string assetPath = "Assets/ResourcesOut/Effect/";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UIEffect/";
|
| | | static string assetPath = "Assets/ResourcesOut/UIEffect/";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Effect(All) AssetBundleName")]
|
| | | public static void SetAllEffectPrefabAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.prefab", SearchOption.AllDirectories);
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.asset", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
|
| | | var pathStringArray = file.DirectoryName.Split("UIEffect");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | Debug.Log(importerPath);
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "effect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | importer.assetBundleName = "uieffect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.json", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split("UIEffect");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "uieffect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.txt", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split("UIEffect");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "uieffect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.png", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split("UIEffect");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "uieffect/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
|
| | | Debug.Log("Effect资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
| | |
|
| | | public class UpdateMobSetting
|
| | | {
|
| | | 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/Gmodels/A_Zs/Materials";
|
| | | static string fsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Gmodels/A_Fs/Materials";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Hero";
|
| | | static string assetPath = "Assets/ResourcesOut/Hero";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Mob(All) AssetBundleName")]
|
| | | public static void SetAllMobAssetBundleName()
|
| | | {
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | var allFiles = new DirectoryInfo(rootPath).GetFiles("*.asset", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = assetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | | var pathStringArray = file.DirectoryName.Split("Hero");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | var hostfix = file.Name.Replace("Prefab_Secondary", "")
|
| | | .Replace("Prefab_Weapon", "")
|
| | | .Replace("Prefab_Wing", "")
|
| | | .Replace("Prefab_Race", "")
|
| | | .Replace("Prefab_Horse", "")
|
| | | .Replace("_UI", "")
|
| | | .Replace(".prefab", "")
|
| | | .Replace("Prefab_Hand", "");
|
| | |
|
| | | importer.assetBundleName = StringUtility.Contact("gmodels/prefab_race", hostfix);
|
| | | importer.assetBundleName = "hero/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(createroleRoot).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.json", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = createroleAssetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | | var pathStringArray = file.DirectoryName.Split("Hero");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "gmodels/createrole";
|
| | | importer.assetBundleName = "hero/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | //var zsMaterialFiles = new DirectoryInfo(zsMaterialPath_Origin).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | //if (!Directory.Exists(zsMaterialPath_OutPut))
|
| | | //{
|
| | | // Directory.CreateDirectory(zsMaterialPath_OutPut);
|
| | | //}
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.txt", SearchOption.AllDirectories);
|
| | |
|
| | | //foreach (var file in zsMaterialFiles)
|
| | | //{
|
| | | // var fileName = Path.GetFileName(file.FullName);
|
| | | // File.Copy(file.FullName, StringUtility.Contact(zsMaterialPath_OutPut, "/", fileName), true);
|
| | | //}
|
| | |
|
| | | //var fsMaterialFiles = new DirectoryInfo(fsMaterialPath_Origin).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | //if (!Directory.Exists(fsMaterialPath_OutPut))
|
| | | //{
|
| | | // Directory.CreateDirectory(fsMaterialPath_OutPut);
|
| | | //}
|
| | |
|
| | | //foreach (var file in fsMaterialFiles)
|
| | | //{
|
| | | // 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)
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | 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 pathStringArray = file.DirectoryName.Split("Hero");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "hero/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | var fsMaterialPathOutFiles = new DirectoryInfo(fsMaterialPath_OutPut).GetFiles("*.mat", SearchOption.TopDirectoryOnly);
|
| | | foreach (var _file in fsMaterialPathOutFiles)
|
| | | allFiles = new DirectoryInfo(rootPath).GetFiles("*.png", SearchOption.AllDirectories);
|
| | |
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | 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);
|
| | | var pathStringArray = file.DirectoryName.Split("Hero");
|
| | | var importerPath = assetPath + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "hero/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
|
| | | //foreach (var file in zsMaterialFiles)
|
| | | //{
|
| | | // var fileName = Path.GetFileName(file.FullName);
|
| | | // var importerPath = assetPath + "/A_Zs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "gmodels/a_zs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | |
|
| | | //foreach (var file in fsMaterialFiles)
|
| | | //{
|
| | | // var fileName = Path.GetFileName(file.FullName);
|
| | | // var importerPath = assetPath + "/A_Fs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "gmodels/a_fs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | | Debug.Log("Gmodels资源包名更新完成!");
|
| | | Debug.Log("Hero资源包名更新完成!");
|
| | | //AssetDatabase.SaveAssets();
|
| | | //AssetDatabase.Refresh();
|
| | | }
|
| | |
| | |
|
| | | 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/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"};
|
| | |
|
| | | [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);
|
| | | // importer.assetBundleName = "config/scriptableobjects";
|
| | | // // EditorUtility.SetDirty(importer);
|
| | | // }
|
| | | // }
|
| | | // Debug.Log("ScriptableObject资源包名更新完成!");
|
| | | // // AssetDatabase.SaveAssets();
|
| | | // // AssetDatabase.Refresh();
|
| | | // }
|
| | | }
|
| | |
|
| | | public class UpdateLevelSetting
|
| | |
| | | static string assetPath = "Assets/Art/Maps/Scenes";
|
| | | static HashSet<string> exportMaps;//去除的地图列表
|
| | |
|
| | | public static void SetCreateRoleLevel(string pattern)
|
| | | {
|
| | | var root = Application.dataPath + "/Art/Maps/Scenes/Map_CreateRole";
|
| | | var from = Application.dataPath + "/Art/Maps/Scenes/Map_CreateRole/" + "CreateRole_" + pattern + ".unity";
|
| | | var to = Application.dataPath + "/Art/Maps/Scenes/" + "CreateRole_001.unity";
|
| | |
|
| | | if (File.Exists(from))
|
| | | {
|
| | | if (File.Exists(to))
|
| | | {
|
| | | File.Delete(to);
|
| | | }
|
| | | File.Copy(from, to);
|
| | | }
|
| | | }
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Level(All) AssetBundleName")]
|
| | | public static void SetAllLevelAssetBundleName()
|
| | | {
|
| | | ReadExportConfig();
|
| | | // 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);
|
| | | var name = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | if (exportMaps.Contains(name)) //判断这个地图是否被排除,被排除不打包
|
| | | importer.assetBundleName = "";
|
| | | else
|
| | | importer.assetBundleName = "maps/" + name.ToLower();
|
| | | // 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);
|
| | | // var name = Path.GetFileNameWithoutExtension(file.FullName);
|
| | | // if (exportMaps.Contains(name)) //判断这个地图是否被排除,被排除不打包
|
| | | // importer.assetBundleName = "";
|
| | | // else
|
| | | // importer.assetBundleName = "maps/" + name.ToLower();
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | // // 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 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 importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(item));
|
| | | importer.assetBundleName = "maps/textures";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | exportMaps?.Clear();
|
| | | exportMaps = null;
|
| | | // var textures = AssetDatabase.FindAssets("t:Texture2D", new string[] { "Assets/ResourcesOut/Scene/Textures" });
|
| | | // foreach (var item in textures)
|
| | | // {
|
| | | // var importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath(item));
|
| | | // importer.assetBundleName = "maps/textures";
|
| | | // // EditorUtility.SetDirty(importer);
|
| | | // }
|
| | | // exportMaps?.Clear();
|
| | | // exportMaps = null;
|
| | | Debug.Log("map资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|