| | |
| | | public class UpdateSpriteSetting
|
| | | {
|
| | |
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UI/Sprite";
|
| | | static string spriteRelativePath = "Assets/ResourcesOut/UI/Sprite";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Sprite";
|
| | | static string spriteRelativePath = "Assets/ResourcesOut/Sprite";
|
| | |
|
| | | public static void SetRechargeSkin(int pattern)
|
| | | {
|
| | | var toDirectory = Application.dataPath + "/ResourcesOut/UI/Sprite/Recharge";
|
| | | var toDirectory = Application.dataPath + "/ResourcesOut/Sprite/Recharge";
|
| | | var oldFiles = new DirectoryInfo(toDirectory).GetFiles("*.png", SearchOption.AllDirectories);
|
| | | foreach (var item in oldFiles)
|
| | | {
|
| | |
| | | {
|
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + file.Name.Split(".")[0].ToLower();
|
| | | importer.assetBundleName = "sprite/" + file.Name.Split(".")[0].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
|
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | importer.assetBundleName = "sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public class UpdateUIWindowSetting
|
| | | {
|
| | | static string assetRelativePath = "Assets/ResourcesOut/UI/Window";
|
| | | static string assetRelativePath2 = "Assets/ResourcesOut/UI/PriorityWindow";
|
| | | static string assetRelativePath = "Assets/ResourcesOut/UI";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Window(All) AssetBundleName")]
|
| | | public static void SetAllUIWindowAssetBundleName()
|
| | |
| | | {
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = "ui/window";
|
| | | importer.assetBundleName = "ui";
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | guids = AssetDatabase.FindAssets("t:prefab", new string[] { assetRelativePath2 });
|
| | | foreach (var guid in guids)
|
| | | {
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = StringUtility.Contact("ui/prioritywindow/", Path.GetFileNameWithoutExtension(path).ToLower());
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | Debug.Log("Window资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
| | |
|
| | | public class UpdateUIPrefabSetting
|
| | | {
|
| | | static string prefabRootPath = Application.dataPath + "/ResourcesOut/UI/Prefab";
|
| | | static string prefabAssetRelativePath = "Assets/ResourcesOut/UI/Prefab";
|
| | | static string prefabRootPath = Application.dataPath + "/ResourcesOut/UIComp";
|
| | | static string prefabAssetRelativePath = "Assets/ResourcesOut/UIComp";
|
| | |
|
| | | 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 importerPath = prefabAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/prefab";
|
| | | importer.assetBundleName = "uicomp";
|
| | | // 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);
|
| | | }
|
| | | Debug.Log("Prefab资源包名更新完成!");
|
| | | |
| | | Debug.Log("UIComp资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | | }
|
| | |
| | | if (extension == ".meta")
|
| | | {
|
| | | continue;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | if (extension == ".DS_Store")
|
| | | {
|
| | | continue;
|