public static ReplaceAtalas ShowWindow() { prefabPathList.Clear(); assetPath = Application.dataPath; GetFiles(new DirectoryInfo(assetPath), "*.prefab", ref prefabPathList); if (window == null) { window = EditorWindow.GetWindow(typeof(ReplaceAtalas)) as ReplaceAtalas; } window.titleContent = new GUIContent("ReplaceAtalas"); window.Show(); return(window); }
public static void OpenWindow() { string selectedAssetPath = AssetDatabase.GetAssetPath(Selection.activeObject); if (!string.IsNullOrEmpty(selectedAssetPath) && selectedAssetPath.EndsWith(".prefab")) { ReplaceAtalas window = ShowWindow(); if (window != null) { window.AutoSelctPrefab(selectedAssetPath); } } }