Branch_DNA
parent
1ccdb11b49
commit
199ea5b84c
|
|
@ -42,12 +42,38 @@ public class MoveFile
|
|||
}
|
||||
AssetDatabase.Refresh(); // 刷新AssetDatabase以显示更改
|
||||
}
|
||||
[MenuItem("Tools/复制缺失图片到对应文件夹")]
|
||||
static void CopySelectedAssets()
|
||||
{
|
||||
string[] selectedPaths_vn = AssetDatabase.FindAssets("t:Texture2D", new[] { "Assets/ManagedResources/ArtFont_vn" });
|
||||
foreach (string guid in selectedPaths_vn)
|
||||
{
|
||||
string path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
if (path.EndsWith("_vn.png"))
|
||||
{
|
||||
string path_en = path.Replace("_vn.png", "_en.png");
|
||||
path_en = path_en.Replace("ArtFont_vn", "ArtFont_en");
|
||||
string results = AssetDatabase.AssetPathToGUID(path_en);
|
||||
if (string.IsNullOrEmpty(results))
|
||||
{
|
||||
string[] split = path.Split('/');
|
||||
string[] zhresults = AssetDatabase.FindAssets(split[split.Length-1].Replace("_vn.png", "_zh"));
|
||||
if (zhresults.Length > 0)
|
||||
{
|
||||
string oldPath = AssetDatabase.GUIDToAssetPath(zhresults[0]);
|
||||
string newPath = oldPath.Replace("ArtFont_zh", "ArtFont_temp");
|
||||
string forlder = newPath.Substring(0, newPath.LastIndexOf("/"));
|
||||
Directory.CreateDirectory(forlder);
|
||||
AssetDatabase.CopyAsset(oldPath, newPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
[MenuItem("Tools/比对韩语和英文差异")]
|
||||
static void CheckVnEn()
|
||||
{
|
||||
string[] selectedPaths_vn = AssetDatabase.FindAssets("t:Texture2D", new[] { "Assets/ManagedResources/ArtFont_vn" });
|
||||
//string targetFolderPath = "Assets/NewFolder"; // 目标文件夹路径
|
||||
//Directory.CreateDirectory(targetFolderPath); // 确保文件夹存在
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (string guid in selectedPaths_vn)
|
||||
{
|
||||
|
|
@ -60,7 +86,7 @@ public class MoveFile
|
|||
if (string.IsNullOrEmpty(results))
|
||||
{
|
||||
string[] split = path.Split('/');
|
||||
sb.Append(split[split.Length-1]+"\n");
|
||||
sb.Append(split[split.Length - 1] + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue