当前位置:网站首页>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();
}
边栏推荐
- Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
- Li Kou brush question diary /day4/6.26
- 千万不要只学 Oracle、MySQL!
- C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
- 资料下载 丨首届腾讯技术开放日课程精华!
- C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
- 从实时应用角度谈通信总线仲裁机制和网络流控
- ESP32-C3入门教程 问题篇⑫——undefined reference to rom_temp_to_power, in function phy_get_romfunc_addr
- My colleagues quietly told me that flying Book notification can still play like this
- Scala基础教程--20--Akka
猜你喜欢

整理混乱的头文件,我用include what you use

更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?

Microservice architecture debate between radical technologists vs Project conservatives

Scala基础教程--17--集合

物联网应用技术的就业前景和现状

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

NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读

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

LeetCode第300场周赛(20220703)

英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
随机推荐
Li Kou brush question diary /day2/2022.6.24
英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
Scala basic tutorial -- 18 -- set (2)
基于C语言的菜鸟驿站管理系统
Scala基础教程--18--集合(二)
IBM WebSphere MQ retrieving messages
SSL证书续费相关问题详解
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
模板_大整数减法_无论大小关系
876. 链表的中间结点
数组中的第K个最大元素
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
Deleting nodes in binary search tree
Process of manually encrypt the mass-producing firmware and programming ESP devices
The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
How to modify icons in VBS or VBE
MXNet对GoogLeNet的实现(并行连结网络)
2022健康展,北京健博会,中国健康展,大健康展11月13日
C language printing exercise