当前位置:网站首页>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();
}
边栏推荐
- 奥迪AUDI EDI INVOIC发票报文详解
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- 【uniapp】uniapp开发app在线预览pdf文件
- 【OpenCV入门到精通之九】OpenCV之视频截取、图片与视频互转
- Scala基础教程--19--Actor
- 神经网络物联网平台搭建(物联网平台搭建实战教程)
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- 发送和接收IBM WebSphere MQ消息
- Torchdrug tutorial
- 其他InterSystems %Net工具
猜你喜欢
随机推荐
【2022年江西省研究生数学建模】冰壶运动 思路分析及代码实现
基于unity的愤怒的小鸟设计
Scala basic tutorial -- 14 -- implicit conversion
Caché WebSocket
Go微服务(二)——Protobuf详细入门
2019年蜀山区第十五届青少年信息学竞赛
【机器学习的数学基础】(一)线性代数(Linear Algebra)(上+)
Scala basic tutorial -- 13 -- advanced function
6.26cf simulation race e: solution to the problem of price maximization
[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
奥迪AUDI EDI INVOIC发票报文详解
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
Detailed explanation of issues related to SSL certificate renewal
What if the self incrementing ID of online MySQL is exhausted?
Li Kou brush question diary /day3/2022.6.25
输入的查询SQL语句,是如何执行的?
【uniapp】uniapp开发app在线预览pdf文件
How to modify icons in VBS or VBE
小发猫物联网平台搭建与应用模型