当前位置:网站首页>Unity editor extends C to traverse all pictures in folders and subdirectories
Unity editor extends C to traverse all pictures in folders and subdirectories
2022-07-04 19:21:00 【charlsdm】
Below is the editor extension I wrote myself about traversing all the pictures under the folder and subdirectories , For reference only
[MenuItem(" Editor Extension about atlas /C# Traverse all pictures in folders and subdirectories ")]
static void RefreshAllPicture()
{
string[] DebugAllImage = new string[] {
};
DebugAllImage=KnowAllPicture();
}
public static string[] KnowAllPicture()
{
List<string> liststring = new List<string>();
string myfolderPath = "PicTureFolder";
string path = Path.Combine(Application.dataPath, myfolderPath);
var images = Directory.GetFiles(path, ".", SearchOption.AllDirectories).Where(s => s.EndsWith(".png") || s.EndsWith(".jpg"));
foreach(var i in images)
{
var str = i.Replace(Application.dataPath, "");
var strpath = str.Replace("\\", "/");
strpath = "Assets" + strpath;
liststring.Add(strpath);
}
foreach(var item in liststring)
{
Debug.Log($"ITem:{
item}\n");
}
return liststring.ToArray();
}
边栏推荐
- php伪原创api对接方法
- 模板_大整数减法_无论大小关系
- node_exporter部署
- Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- Mxnet implementation of googlenet (parallel connection network)
- [发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
- Scala basic tutorial -- 19 -- actor
- 6.26CF模拟赛E:价格最大化题解
- 李迟2022年6月工作生活总结
猜你喜欢
Li Kou brush question diary /day1/2022.6.23
Li Kou brush question diary /day4/6.26
LeetCode第300场周赛(20220703)
[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation
BI技巧丨权限轴
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
中国农科院基因组所汪鸿儒课题组诚邀加入
Wireshark网络抓包
自由小兵儿
随机推荐
性能优化之关键渲染路径
英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
ESP32-C3入门教程 问题篇⑫——undefined reference to rom_temp_to_power, in function phy_get_romfunc_addr
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
redis分布式锁的8大坑总结梳理
Don't just learn Oracle and MySQL!
【OpenCV入门到精通之九】OpenCV之视频截取、图片与视频互转
[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation
2022健康展,北京健博会,中国健康展,大健康展11月13日
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Scala basic tutorial -- 15 -- recursion
ThreadLocal原理与使用
2021 合肥市信息学竞赛小学组
2022年字节跳动日常实习面经(抖音)
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
Rookie post station management system based on C language
1672. 最富有客户的资产总量
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
Scala basic tutorial -- 13 -- advanced function
完善的js事件委托