Skip to content

Commit f58d12c

Browse files
committed
[change] refactor code comments and translate them to English
1 parent d5eaa35 commit f58d12c

6 files changed

Lines changed: 26 additions & 23 deletions

File tree

Editor/Settings/EditorStatusWatcher.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
namespace HybridCLR.Editor.Settings
77
{
88

9-
/// <summary>
10-
/// 监听编辑器状态,当编辑器重新 focus 时,重新加载实例,避免某些情景下 svn 、git 等外部修改了数据却无法同步的异常。
11-
/// </summary>
129
[InitializeOnLoad]
1310
public static class EditorStatusWatcher
1411
{

Editor/Settings/HybridCLRSettingProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ public override void OnGUI(string searchContext)
123123
{
124124
using (CreateSettingsWindowGUIScope())
125125
{
126-
//解决编辑器打包时出现的 _serializedObject.targetObject 意外销毁的情况
127126
if (_serializedObject == null||!_serializedObject.targetObject)
128127
{
129128
InitGUI();

Editor/SettingsUtil.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ class AssemblyDefinitionData
6565
public string name;
6666
}
6767

68-
/// <summary>
69-
/// 热更新dll列表。不包含 preserveHotUpdateAssemblies。
70-
/// </summary>
7168
public static List<string> HotUpdateAssemblyNamesExcludePreserved
7269
{
7370
get

Runtime/HomologousImageMode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace HybridCLR
33
{
44
public enum HomologousImageMode
55
{
6-
Consistent, // AOT dll需要跟主工程精确一致,即为裁剪后的AO dll
7-
SuperSet, // AOT dll不需要跟主工程精确一致,但必须包含裁剪后的AOT dll的所有元数据,即为裁剪后dll的超集。推荐使用原始aot dll
6+
Consistent,
7+
SuperSet,
88
}
99
}
1010

Runtime/LoadImageErrorCode.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ namespace HybridCLR
44
public enum LoadImageErrorCode
55
{
66
OK = 0,
7-
BAD_IMAGE, // dll 不合法
8-
NOT_IMPLEMENT, // 不支持的元数据特性
9-
AOT_ASSEMBLY_NOT_FIND, // 对应的AOT assembly未找到
10-
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据
11-
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充
12-
INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode
13-
PDB_BAD_FILE, // pdb文件不合法
14-
};
7+
BAD_IMAGE, // invalid dll file
8+
NOT_IMPLEMENT, // not implement feature
9+
AOT_ASSEMBLY_NOT_FIND, // AOT assembly not found
10+
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // can not load supplementary metadata assembly for non-AOT assembly
11+
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // can not load supplementary metadata assembly for the same assembly
12+
INVALID_HOMOLOGOUS_MODE, // invalid homologous image mode
13+
PDB_BAD_FILE, // invalid pdb file
14+
};
1515
}
1616

Runtime/RuntimeApi.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace HybridCLR
1414
public static class RuntimeApi
1515
{
1616
/// <summary>
17-
/// 加载补充元数据assembly
17+
/// load supplementary metadata assembly
1818
/// </summary>
1919
/// <param name="dllBytes"></param>
2020
/// <returns></returns>
@@ -30,7 +30,7 @@ public static unsafe LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllByt
3030
#endif
3131

3232
/// <summary>
33-
/// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
33+
/// get the maximum number of StackObjects in the interpreter thread stack (size*8 represents the final memory size occupied
3434
/// </summary>
3535
/// <returns></returns>
3636
public static int GetInterpreterThreadObjectStackSize()
@@ -39,17 +39,17 @@ public static int GetInterpreterThreadObjectStackSize()
3939
}
4040

4141
/// <summary>
42-
/// 设置解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
42+
/// set the maximum number of StackObjects for the interpreter thread stack (size*8 represents the final memory size occupied)
4343
/// </summary>
4444
/// <param name="size"></param>
4545
public static void SetInterpreterThreadObjectStackSize(int size)
4646
{
4747
SetRuntimeOption(RuntimeOptionId.InterpreterThreadObjectStackSize, size);
4848
}
49-
49+
5050

5151
/// <summary>
52-
/// 获取解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
52+
/// get the number of interpreter thread function frames (sizeof(InterpreterFrame)*size represents the final memory size occupied)
5353
/// </summary>
5454
/// <returns></returns>
5555
public static int GetInterpreterThreadFrameStackSize()
@@ -58,7 +58,7 @@ public static int GetInterpreterThreadFrameStackSize()
5858
}
5959

6060
/// <summary>
61-
/// 设置解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
61+
/// set the number of interpreter thread function frames (sizeof(InterpreterFrame)*size represents the final memory size occupied)
6262
/// </summary>
6363
/// <param name="size"></param>
6464
public static void SetInterpreterThreadFrameStackSize(int size)
@@ -71,6 +71,11 @@ public static void SetInterpreterThreadFrameStackSize(int size)
7171

7272
private static readonly Dictionary<RuntimeOptionId, int> s_runtimeOptions = new Dictionary<RuntimeOptionId, int>();
7373

74+
/// <summary>
75+
/// set runtime option value
76+
/// </summary>
77+
/// <param name="optionId"></param>
78+
/// <param name="value"></param>
7479
public static void SetRuntimeOption(RuntimeOptionId optionId, int value)
7580
{
7681
s_runtimeOptions[optionId] = value;
@@ -80,6 +85,11 @@ public static void SetRuntimeOption(RuntimeOptionId optionId, int value)
8085
public static extern void SetRuntimeOption(RuntimeOptionId optionId, int value);
8186
#endif
8287

88+
/// <summary>
89+
/// get runtime option value
90+
/// </summary>
91+
/// <param name="optionId"></param>
92+
/// <returns></returns>
8393
#if UNITY_EDITOR
8494
public static int GetRuntimeOption(RuntimeOptionId optionId)
8595
{

0 commit comments

Comments
 (0)