1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System.Collections.Generic;
- using System.IO;
- namespace ET
- {
- public class EditorResHelper
- {
-
-
-
-
-
-
- public static List<string> GetPrefabsAndScenes(string srcPath)
- {
- List<string> paths = new List<string>();
- FileHelper.GetAllFiles(paths, srcPath);
-
- List<string> files = new List<string>();
- foreach (string str in paths)
- {
- if (str.EndsWith(".prefab") || str.EndsWith(".unity"))
- {
- files.Add(str);
- }
- }
- return files;
- }
-
-
-
-
-
-
-
- public static List<string> GetAllResourcePath(string srcPath, bool subDire)
- {
- List<string> paths = new List<string>();
- string[] files = Directory.GetFiles(srcPath);
- foreach (string str in files)
- {
- if (str.EndsWith(".meta"))
- {
- continue;
- }
- paths.Add(str);
- }
- if (subDire)
- {
- foreach (string subPath in Directory.GetDirectories(srcPath))
- {
- List<string> subFiles = GetAllResourcePath(subPath, true);
- paths.AddRange(subFiles);
- }
- }
- return paths;
- }
- }
- }
|