当前位置:网站首页>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();
}
边栏推荐
- Scala基础教程--15--递归
- 资料下载 丨首届腾讯技术开放日课程精华!
- Detailed explanation of issues related to SSL certificate renewal
- Cache é JSON uses JSON adapters
- Wireshark packet capturing TLS protocol bar displays version inconsistency
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- 千万不要只学 Oracle、MySQL!
- [发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
- 【OpenCV入门到精通之九】OpenCV之视频截取、图片与视频互转
- LeetCode FizzBuzz C#解答
猜你喜欢
随机推荐
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Use canal and rocketmq to listen to MySQL binlog logs
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
Mxnet implementation of googlenet (parallel connection network)
Summary and sorting of 8 pits of redis distributed lock
李迟2022年6月工作生活总结
启牛开的证券账户安全吗?
性能优化之关键渲染路径
Scala基础教程--19--Actor
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
From automation to digital twins, what can Tupo do?
Technology sharing | interface testing value and system
6.26cf simulation match B: solution to array reduction problem
[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
TorchDrug教程
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
Wireshark packet capturing TLS protocol bar displays version inconsistency
2022养生展,健康展,北京大健康展,健康产业展11月举办
基于C语言的菜鸟驿站管理系统
How to modify icons in VBS or VBE