今天给美术童鞋写了一个小工具来批量修改资源的名称,改一下newName的前缀,拿去用吧
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class ReName
{
[MenuItem("Tools/ReName")]
public static void Rename()
{
Object[] m_objects = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);//选择的所以对象
int index = 0;//序号
foreach (Object item in m_objects)
{
if (Path.GetExtension(AssetDatabase.GetAssetPath(item)) != "")//判断路径是否为空
{
string path = AssetDatabase.GetAssetPath(item);
string newName = "Tex_" + index;
AssetDatabase.RenameAsset(path, newName);
index++;
}
}
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
}