当前位置:网站首页>Unity编辑器扩展批量修改图片名称
Unity编辑器扩展批量修改图片名称
2022-08-03 08:08:00 【charlsdm】
下边附上我的代码
[MenuItem("小黄高级工具/将各种图片更改名字")]
static void PutNewPictureName()
{
ReturnStreamingAssetPngOrPictureName();
AssetDatabase.Refresh();
AssetDatabase.SaveAssets();
}
static List<string> ReturnStreamingAssetPngOrPictureName()
{
string addContent = "es.";
List<string> CurrentName = new List<string>();
List<string> OldName = new List<string>();
string myfolderName = "StreamingAssets";
string path = Path.Combine(Application.dataPath, myfolderName);
var images = Directory.GetFiles(path, ".", SearchOption.AllDirectories).Where(s => s.EndsWith(".png") || s.EndsWith(".jpg"));
foreach (var i in images)
{
OldName.Add(i);
var str = i.Replace(".", addContent);
CurrentName.Add(str);
Debug.Log($"itss:{
str}");
}
for(int i=0;i<CurrentName.Count;i++)
{
File.Move(OldName[i], CurrentName[i]);
}
return CurrentName;
}
边栏推荐
猜你喜欢

实时目标检测新高地之#YOLOv7#更快更强的目标检测器

PowerShell:执行 Install-Module 时,不能从 URI 下载

HCIA实验(07)

IDEA2021.2安装与配置(持续更新)

How does Mysql query two data tables for the same fields in two tables at the same time

循环神经网络RNN基础《PyTorch深度学习实践》

行业洞察 | 如何更好的实现与虚拟人的互动体验?

volta管理node版本

Charles packet capture tool learning record

获取JDcookie的方法
随机推荐
001-进程与线程
流行和声基础大笔记
《剑指Offer》刷题之打印从1到最大的n位数
"Swordsman Offer" brush questions print from 1 to the largest n digits
“唯一索引允许为空“ 的说法是不严谨的
FusionAccess软件架构、FusionAccess必须配置的四个组件、桌面发放流程、虚拟机组类型、桌面组类型
Docker启动mysql
数据监控平台
LeetCode 264:丑数
【TPC-DS】DF的SQL(Data Maintenance部分)
审批流设计
热部署系统实现
The Transformer, BERT, GPT paper intensive reading notes
greenplum role /user 管理
二进制日志过期时间设置expire_logs_days
ArcEngine (1) Loading vector data
RViz报错: Error subscribing: Unable to load plugin for transport ‘compressed‘解决方法
pyspark df secondary sorting
IDEA2021.2安装与配置(持续更新)
timestamp