📅  最后修改于: 2022-03-11 14:49:19.885000             🧑  作者: Mango
using System.IO;
using System.Collections;
var files = Directory.GetFiles("C:/path_example/example", "*.png"); //.png can be changed to match any other desired extentions
string randomFilePath= files[Random.Range(0,files.Length)];
//example output: "C:/path_example/example/pig4.png"