当前位置:网站首页>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 basic tutorial -- 20 -- akka
- [uniapp] uniapp development app online Preview PDF file
- Esp32-c3 introductory tutorial questions ⑫ - undefined reference to ROM_ temp_ to_ power, in function phy_ get_ romfunc_ addr
- Wireshark抓包TLS协议栏显示版本不一致问题
- 整理混乱的头文件,我用include what you use
- 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
- 信息学奥赛一本通 1336:【例3-1】找树根和孩子
- Scala basic tutorial -- 12 -- Reading and writing data
- 数组中的第K个最大元素
- From automation to digital twins, what can Tupo do?
猜你喜欢

My colleagues quietly told me that flying Book notification can still play like this

神经网络物联网应用技术学什么

Rookie post station management system based on C language

字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验

奥迪AUDI EDI INVOIC发票报文详解

How to modify icons in VBS or VBE

One question per day (2022-07-02) - Minimum refueling times

【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现

神经网络物联网是什么意思通俗的解释

Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
随机推荐
Halcon template matching
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
问下各位大佬有用过cdc直接mysql to clickhouse的么
【机器学习的数学基础】(一)线性代数(Linear Algebra)(上+)
1、 Introduction to C language
Scala基础教程--12--读写数据
Scala basic tutorial -- 13 -- advanced function
2019年蜀山区第十五届青少年信息学竞赛
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
Scala基础教程--18--集合(二)
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
中国农科院基因组所汪鸿儒课题组诚邀加入
ThreadLocal原理与使用
Technology sharing | interface testing value and system
LeetCode FizzBuzz C#解答
DeFi生态NFT流动性挖矿系统开发搭建
Perfect JS event delegation
【2022年江西省研究生数学建模】冰壶运动 思路分析及代码实现
Scala基础教程--13--函数进阶
读写关闭的channel是啥后果?