这个是简单的进行浏览文件夹里面的文件并且进行保存,我这是以.jpg为例子,错误地方,纠正,指教
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class RecordID : MonoBehaviour
{
void Start()
{
string fullPath = Application.dataPath + "/你的文件夹名字/";
List<string> nameList = new List<string>();
//获取指定路径下面的所有资源文件
if (Directory.Exists(fullPath))
{
DirectoryInfo direction = new DirectoryInfo(fullPath);
FileInfo[] files = direction.GetFiles("*.jpg", SearchOption.AllDirectories);//jpg为例
for (int i = 0; i < files.Length; i++)
{
nameList.Add(files[i].Name);//进行保存
}
}
}
}