当前位置:网站首页>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();
}
边栏推荐
- Using SSH
- 1672. 最富有客户的资产总量
- [opencv introduction to mastery 9] opencv video capture, image and video conversion
- SSL证书续费相关问题详解
- Nebula Importer 数据导入实践
- 基于unity的愤怒的小鸟设计
- 千万不要只学 Oracle、MySQL!
- How is the entered query SQL statement executed?
- 字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
- 2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import 'fmt' func
猜你喜欢

从实时应用角度谈通信总线仲裁机制和网络流控

奥迪AUDI EDI INVOIC发票报文详解

Scala基础教程--13--函数进阶

Rookie post station management system based on C language

MXNet对GoogLeNet的实现(并行连结网络)

Scala基础教程--15--递归

A method of using tree LSTM reinforcement learning for connection sequence selection

ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development

Scala基础教程--19--Actor

Torchdrug tutorial
随机推荐
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
repeat_P1002 [NOIP2002 普及组] 过河卒_dp
Scala基础教程--14--隐式转换
prometheus安装
使用FTP
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
PB的扩展DLL开发(超级篇)(七)
Caché WebSocket
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
[release] a tool for testing WebService and database connection - dbtest v1.0
【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Perfect JS event delegation
Scala basic tutorial -- 15 -- recursion
[go ~ 0 to 1] read, write and create files on the sixth day
C语言打印练习
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
Download the first Tencent technology open day course essence!
Scala基础教程--19--Actor
Halcon template matching