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