| | |
| | | [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)
|
| | | {
|
| | |
| | | importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
|
| | | DebugEx.Log("Sprite资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
| | |
|
| | | public class UpdateMobSetting
|
| | | {
|
| | | 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 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);
|
| | | importer.assetBundleName = StringUtility.Contact("gmodels/prefab_race", hostfix);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | var importerPath = createroleAssetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "mob/createrole";
|
| | | importer.assetBundleName = "gmodels/createrole";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | if (_file.Name.StartsWith("A_Zs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
| | | if (_file.Name.StartsWith("A_Fs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
| | | // 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("Mob资源包名更新完成!");
|
| | | DebugEx.Log("Gmodels资源包名更新完成!");
|
| | | //AssetDatabase.SaveAssets();
|
| | | //AssetDatabase.Refresh();
|
| | | }
|
| | |
| | | }
|
| | | exportMaps?.Clear();
|
| | | exportMaps = null;
|
| | | DebugEx.Log("Level资源包名更新完成!");
|
| | | DebugEx.Log("map资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | DebugEx.Log("BuiltIn资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|