啊 ,好多英文,头晕,脑壳疼,看不懂?
没关系,EasyWork v0.01 版本来了
用的是百度翻译,使用前请先申请百度翻译开发者
Ctrl+F 搜索 害羞的代码 ,更改为自己的账号密码
代码放到工程中,选中资源文件夹,右键选择 EasyWork
直接上代码
/********************************************************
文件: 一键翻译.cs
作者: UserName
日期: CreateTime
寄语: 虎年 虎虎生威 大吉大利
功能: Nothing
*********************************************************/
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using UnityEditor;
using System.Threading.Tasks;
public class 一键翻译
{
public class TranstionResult
{
//错误码,翻译结果无法正常返回
public string Error_code {
get; set; }
public string Error_msg {
get; set; }
public string from {
get; set; }
public string to {
get; set; }
public string Query {
get; set; }
//翻译正确,返回的结果
//这里是数组的原因是百度翻译支持多个单词或多段文本的翻译,在发送的字段q中用换行符(\n)分隔
public Translation[] trans_result {
get; set; }
public Dictionary<string, string> GetStringList()
{
Dictionary<string, string> list = new Dictionary<string, string>();
foreach (var item in trans_result)
{
list.Add(item.src, item.dst);
}
return list;
}
}
[MenuItem("Assets/阿飞的EasyWork/修改当前所有子文件名为中文")]
public static async void Click()
{
List<CustomFile> fils =GetChildFileAll();
int num = 0;
while (num < fils.Count)
{
string totranslationText = "";
for (int i = num; i < num + 50; i++)
{
if

这是一个Unity编辑器插件,使用百度翻译API实现批量翻译文件名,并进行一键修改。适用于快速将英文资源文件名翻译成中文,提高工作效率。
最低0.47元/天 解锁文章
2433

被折叠的 条评论
为什么被折叠?



