public static string[] GetFilePath(string path)
{
if (Directory.Exists(path))
{
//文件路径
string[] dir = Directory.GetDirectories(path);
//文件名
string[] names = new string[dir.Length];
for (int i = 0; i < dir.Length; i++)
{
//赋值文件命名
names[i] = Path.GetFileName(dir[i]);
}
return names;
}
else
{
Debug.LogError("未找到路径");
return null;
}
}