| | |
| | |
|
| | | 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);
|
| | | }
|