当前位置:网站首页>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();
}
边栏推荐
- Esp32-c3 introductory tutorial questions ⑫ - undefined reference to ROM_ temp_ to_ power, in function phy_ get_ romfunc_ addr
- 大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
- 神经网络物联网是什么意思通俗的解释
- IBM WebSphere MQ retrieving messages
- 奥迪AUDI EDI INVOIC发票报文详解
- Scala basic tutorial -- 12 -- Reading and writing data
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- Nebula Importer 数据导入实践
- 模板_判断素数_开方 / 六素数法
- Cache é JSON uses JSON adapters
猜你喜欢

1、 Introduction to C language

Uni app and uviewui realize the imitation of Xiaomi mall app (with source code)

Angry bird design based on unity

性能优化之关键渲染路径

神经网络物联网应用技术就业前景【欢迎补充】

Li Kou brush question diary /day1/2022.6.23

Mxnet implementation of googlenet (parallel connection network)

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

Go microservice (II) - detailed introduction to protobuf

2022 ByteDance daily practice experience (Tiktok)
随机推荐
1672. 最富有客户的资产总量
My colleagues quietly told me that flying Book notification can still play like this
2022健康展,北京健博会,中国健康展,大健康展11月13日
Scala基础教程--12--读写数据
IBM WebSphere MQ retrieving messages
李迟2022年6月工作生活总结
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func
redis分布式锁的8大坑总结梳理
神经网络物联网是什么意思通俗的解释
正则替换【JS,正则表达式】
LeetCode第300场周赛(20220703)
How to modify icons in VBS or VBE
奥迪AUDI EDI INVOIC发票报文详解
Is the securities account opened by qiniu safe?
[mathematical modeling of graduate students in Jiangxi Province in 2022] analysis and code implementation of haze removal by nucleation of water vapor supersaturation
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
vbs或vbe如何修改图标