update editor
1. 编辑器界面支持本地化配置。 2. 资源构建过程中的异常输出增加错误码提示。 3. 修复了资源构建界面乱码问题。 4. 修复了自动收集着色器对依赖资源无效的问题。
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public interface ILocalization
|
||||
{
|
||||
string GetLanguage(ELanguageKey key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a034d1ededabd44dbb1c7b4cf4772f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public enum ELanguageKey
|
||||
{
|
||||
None,
|
||||
|
||||
// AssetBundleBuilder
|
||||
ABB_WindowTitle,
|
||||
AAB_NoPackageTips,
|
||||
ABB_BuildOutput,
|
||||
ABB_BuildVersion,
|
||||
ABB_BuildMode,
|
||||
ABB_Encryption,
|
||||
ABB_Compression,
|
||||
ABB_FileNameStyle,
|
||||
ABB_CopyBuildinFileOption,
|
||||
ABB_CopyBuildinFileTags,
|
||||
ABB_ClickBuild,
|
||||
|
||||
// AssetBundleCollector
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fef97c24f81187488b84dfa60f36d62
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd20abe0407ec2f469ee2f8166248262
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public class ChineseSimplified : ILocalization
|
||||
{
|
||||
public string GetLanguage(ELanguageKey key)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case ELanguageKey.None: return "Invalid language";
|
||||
|
||||
// AssetBundleBuilder
|
||||
case ELanguageKey.ABB_WindowTitle: return "资源包构建工具";
|
||||
case ELanguageKey.AAB_NoPackageTips: return "没有发现可构建的资源包";
|
||||
case ELanguageKey.ABB_BuildOutput: return "构建输出目录";
|
||||
case ELanguageKey.ABB_BuildVersion: return "构建版本";
|
||||
case ELanguageKey.ABB_BuildMode: return "构建模式";
|
||||
case ELanguageKey.ABB_Encryption: return "加密方法";
|
||||
case ELanguageKey.ABB_Compression: return "压缩方式";
|
||||
case ELanguageKey.ABB_FileNameStyle: return "文件命名方式";
|
||||
case ELanguageKey.ABB_CopyBuildinFileOption: return "内置文件拷贝选项";
|
||||
case ELanguageKey.ABB_CopyBuildinFileTags: return "内置文件拷贝参数";
|
||||
case ELanguageKey.ABB_ClickBuild: return "开始构建";
|
||||
|
||||
// AssetBundleCollector
|
||||
|
||||
default:
|
||||
{
|
||||
Debug.LogError($"Not found language : {key}");
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65cd951ca39cd1b469691424350f5bc6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27a994f8cae769f4e9aa986c3ecb5079
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
internal static class Localization
|
||||
{
|
||||
private static ILocalization _localization;
|
||||
|
||||
static Localization()
|
||||
{
|
||||
var types = EditorTools.GetAssignableTypes(typeof(ILocalization));
|
||||
_localization = (ILocalization)Activator.CreateInstance(types[0]);
|
||||
CheckContent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检测多语言是否配置完整
|
||||
/// </summary>
|
||||
private static void CheckContent()
|
||||
{
|
||||
foreach (ELanguageKey key in Enum.GetValues(typeof(ELanguageKey)))
|
||||
{
|
||||
_localization.GetLanguage(key);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字符串转换为枚举类型
|
||||
/// </summary>
|
||||
public static ELanguageKey Convert(string enumName)
|
||||
{
|
||||
return (ELanguageKey)Enum.Parse(typeof(ELanguageKey), enumName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取多语言内容
|
||||
/// </summary>
|
||||
public static string Language(ELanguageKey key, params object[] args)
|
||||
{
|
||||
string content = _localization.GetLanguage(key);
|
||||
if (args.Length > 0)
|
||||
return string.Format(content, args);
|
||||
else
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f2558d1b74a918449486d37aecdd850
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user