批量修改名字
using UnityEditor; using System.IO; using UnityEngine; public class SC { [MenuItem("Assets/批量修改名字")] public static void PlacePrfab() { Object[] slecets = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets); foreach (Object item in slecets) { if (Path.GetExtension(AssetDatabase.GetAssetPath(item))!="") { string path = AssetDatabase.GetAssetPath(item); if(item.name.StartsWith("gt")) { var a = item.name.Substring(2); AssetDatabase.RenameAsset(path,"SCPoker"+a); } } } AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } }