| | |
| | |
|
| | | 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
|