unityzgy/.svn/pristine/93/9317215055bd55fed0f54639e503bde9401e973d.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

101 lines
4.0 KiB
Plaintext

// SteamVR Defines|SDK_SteamVR|001
namespace VRTK
{
using System;
using System.Reflection;
/// <summary>
/// Handles all the scripting define symbols for the SteamVR SDK.
/// </summary>
public static class SDK_SteamVRDefines
{
/// <summary>
/// The scripting define symbol for the SteamVR SDK.
/// </summary>
public const string ScriptingDefineSymbol = SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "SDK_STEAMVR";
private const string BuildTargetGroupName = "Standalone";
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "STEAMVR_PLUGIN_1_2_2_OR_NEWER", BuildTargetGroupName)]
private static bool IsPluginVersion122OrNewer()
{
Type controllerManagerClass = VRTK_SharedMethods.GetTypeUnknownAssembly("SteamVR_ControllerManager");
if (controllerManagerClass == null)
{
return false;
}
return controllerManagerClass.GetMethod("SetUniqueObject", BindingFlags.NonPublic | BindingFlags.Instance) != null;
}
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "STEAMVR_PLUGIN_1_2_1_OR_NEWER", BuildTargetGroupName)]
private static bool IsPluginVersion121OrNewer()
{
Type eventClass = VRTK_SharedMethods.GetTypeUnknownAssembly("SteamVR_Events");
if (eventClass == null)
{
return false;
}
MethodInfo systemMethod = eventClass.GetMethod("System", BindingFlags.Public | BindingFlags.Static);
if (systemMethod == null)
{
return false;
}
ParameterInfo[] systemMethodParameters = systemMethod.GetParameters();
if (systemMethodParameters.Length != 1)
{
return false;
}
return systemMethodParameters[0].ParameterType == VRTK_SharedMethods.GetTypeUnknownAssembly("Valve.VR.EVREventType");
}
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "STEAMVR_PLUGIN_1_2_0", BuildTargetGroupName)]
private static bool IsPluginVersion120()
{
Type eventClass = VRTK_SharedMethods.GetTypeUnknownAssembly("SteamVR_Events");
if (eventClass == null)
{
return false;
}
MethodInfo systemMethod = eventClass.GetMethod("System", BindingFlags.Public | BindingFlags.Static);
if (systemMethod == null)
{
return false;
}
ParameterInfo[] systemMethodParameters = systemMethod.GetParameters();
if (systemMethodParameters.Length != 1)
{
return false;
}
return systemMethodParameters[0].ParameterType == typeof(string);
}
[SDK_ScriptingDefineSymbolPredicate(ScriptingDefineSymbol, BuildTargetGroupName)]
[SDK_ScriptingDefineSymbolPredicate(SDK_ScriptingDefineSymbolPredicateAttribute.RemovableSymbolPrefix + "STEAMVR_PLUGIN_1_1_1_OR_OLDER", BuildTargetGroupName)]
private static bool IsPluginVersion111OrOlder()
{
Type utilsClass = VRTK_SharedMethods.GetTypeUnknownAssembly("SteamVR_Utils");
if (utilsClass == null)
{
return false;
}
Type eventClass = utilsClass.GetNestedType("Event");
if (eventClass == null)
{
return false;
}
return eventClass.GetMethod("Listen", BindingFlags.Public | BindingFlags.Static) != null;
}
}
}