有个文件夹里面有很多的图片,都是.png格式的,要是一个一个的拖到脚本上觉得很麻烦,就写了一个遍历添加的cars,变量是List<Sprite> 代码如下: using UnityEngine; using System.IO; using System.Collections.Generic; public class NewBehaviourScript : MonoBehaviour { private List<Texture> cars = new List<Tex
function getAllFiles(folderName,houzhui){ folderName var regthis = new RegExp( '.+\.('+houzhui+')$','i'); var inFolder = new Folder(folderName) var fileList = null if(inFolder != null){ var fileList = inFolder.getFiles(regthis); } return fileList } f