Skip to content

Commit

Permalink
修复文档错误
Browse files Browse the repository at this point in the history
  • Loading branch information
walon committed Jun 12, 2023
1 parent 2c2d7a1 commit 43d2415
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/basic/com.code-philosophy.hybridclr.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ hybridclr代码要兼容多个Unity版本,需要当前Unity版本相关宏定
扫描热更新dll引用的AOT类型,生成link.xml,避免热更新脚本用到的AOT类型或函数被裁剪。输出的文件路径在 HybridCLRSettings.asset中`OuputLinkXml`字段中指定,默认为`LinkGenerator/link.xml`。
更具体的裁剪相关介绍请看[代码裁剪原理及解决办法](/hybridclr/code_striping/)。
更具体的裁剪相关介绍请看[代码裁剪原理及解决办法](codestriping.md)。
### Generate/AotDlls
Expand All @@ -107,7 +107,7 @@ hybridclr代码要兼容多个Unity版本,需要当前Unity版本相关宏定
### Generate/MethodBridge
根据当前的AOT dll集扫描生成桥接函数文件。相关文档请看[桥接函数](/basic/methodbridge.md)。
根据当前的AOT dll集扫描生成桥接函数文件。相关文档请看[桥接函数](methodbridge.md)。
生成桥接函数依赖AOT dlls和热更新dlls。如果你没有用 `HybridCLR/Generate/All` 这样的一键生成命令,请依次运行以下命令:
Expand Down Expand Up @@ -362,7 +362,7 @@ package中 `Editor/Data~/iOSBuild` 包含了编译iOS版本libil2cpp.a所需的

如果项目中用于xlua之类的脚本语言,对于要注册到lua中的C#函数,都需要添加`[MonoPInvokeCallback]`注解。这样可以为这些C#函数返回一个对应的c++
函数指针,用于注册到脚本语言里。HybridCLR支持将热更新C#代码注册到lua中,但必须提前生成与`[MonoPInvokeCallback]`对应的C++桩函数,才可能为每个C#函数返回一个相应的C++函数指针。
脚本提供了自动生成桩函数的功能。详细请见 [MonoPInvokeCallback支持](/advanced/workwithscriptlanguage.md)[HybridCLR+lua/js/python](/hybridclr/work_with_script_language/) 文档
脚本提供了自动生成桩函数的功能。详细请见 [MonoPInvokeCallback支持](/advanced/workwithscriptlanguage.md)[HybridCLR+lua/js/python](../advanced/workwithscriptlanguage.md) 文档

每个带 `[MonoPInvokeCallback]` 特性的函数都需要一个唯一对应的wrapper函数。这些wrapper函数必须是打包时预先生成,不可变化。
因此如果后续热更新新增了 带 `[MonoPInvokeCallback]` 特性的函数,则会发生wrapper函数不足的情况。ReversePInvokeWrapperGenerationAttribute
Expand Down
2 changes: 1 addition & 1 deletion docs/help/commonerrors.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ com.code-philosophy.hybridclr 与 hybridclr及il2cpp_plus版本不匹配导致
否则是因为这个生成依赖于裁剪后的aot dll,而此时aot dll还未生成。有几种原因导致这个结果:

- 你从未在主工程中使用过跟该dll相关代码,导致就算link.xml中保留了,仍然整个被裁剪。解决办法是在主工程中随便写段代码引用该dll中的某个类或函数。
- Unity2021版本,打包iOS平台,使用低于2.0.1版本com.code-philosophy.hybridclr,同时未修改 UnityEditor.CoreModule.dll文件,导致未获得裁剪后的dll。解决办法是升级hybridclr_unity到2.0.1及更高版本或者按照文档[修改Unity编辑器相关dll](/hybridclr/modify_unity_dll/)修改UnityEditor.CoreModule.dll。
- Unity2021版本,打包iOS平台,使用低于2.0.1版本com.code-philosophy.hybridclr,同时未修改 UnityEditor.CoreModule.dll文件,导致未获得裁剪后的dll。解决办法是升级hybridclr_unity到2.0.1及更高版本或者按照文档[修改Unity编辑器相关dll](../advanced/modifyunitydll.md)修改UnityEditor.CoreModule.dll。
- 其他原因。万能的解决办法是手动build一次项目生成aot dll。

### 运行 `HybridCLR/generate/xxx` 时发生 `NullReferenceException. HybridCLR.Editor.ABI.TypeCreatorBase.CreateTypeInfo ...`
Expand Down
2 changes: 1 addition & 1 deletion docs/other/donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
- 流星语传媒 [github](https://github.com/ChineseGod)
- 光辉 [github](https://github.com/guanghui1987)
- 光头佬(485925113)
- han [github](170487453@qq.com)
- han 170487453@qq.com
- 鲶巴啷 (657542753)
- C和弦® (632020710)
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The hybridclr code needs to be compatible with multiple Unity versions, and macr
Scan the AOT type referenced by the hot update dll, generate link.xml, and prevent the AOT type or function used by the hot update script from being clipped. The output file path is specified in the `OuputLinkXml` field in HybridCLRSettings.asset, and the default is `LinkGenerator/link.xml`.
For a more specific introduction to clipping, please see [Code Clipping Principles and Solutions](/hybridclr/code_striping/).
For a more specific introduction to clipping, please see [Code Clipping Principles and Solutions](codestriping.md).
### Generate/AotDlls
Expand All @@ -107,7 +107,7 @@ If you did not use `HybridCLR/Generate/All` such a one-click generation command,
### Generate/MethodBridge
Scan and generate bridge function files according to the current AOT dll set. For related documents, please see [bridge function](../basic/methodbridge.md).
Scan and generate bridge function files according to the current AOT dll set. For related documents, please see [bridge function](methodbridge.md).
Generate bridge function depends on AOT dlls and hot update dlls. If you did not use `HybridCLR/Generate/All` such a one-click generation command, please run the following commands in sequence:
Expand Down Expand Up @@ -362,7 +362,7 @@ The underlying tool class for operating HybridCLR. The more commonly used ones a

If a scripting language such as xlua is used in the project, the `[MonoPInvokeCallback]` annotation needs to be added to the C# function to be registered in lua. This returns a corresponding C++ for these C# functions
Function pointer, used to register in the scripting language. HybridCLR supports registering hot-updated C# code in lua, but the C++ stub function corresponding to `[MonoPInvokeCallback]` must be generated in advance to return a corresponding C++ function pointer for each C# function.
The script provides the function of automatically generating stub functions. For details, see [MonoPInvokeCallback support](../advanced/workwithscriptlanguage.md) and [HybridCLR+lua/js/python](/hybridclr/work_with_script_language/) documents
The script provides the function of automatically generating stub functions. For details, see [MonoPInvokeCallback support](../advanced/workwithscriptlanguage.md) and [HybridCLR+lua/js/python](../advanced/workwithscriptlanguage.md) documents

Each function with the `[MonoPInvokeCallback]` attribute requires a unique corresponding wrapper function. These wrapper functions must be pre-generated during packaging and cannot be changed.
Therefore, if a function with the `[MonoPInvokeCallback]` feature is added in subsequent hot updates, there will be insufficient wrapper functions. ReversePInvokeWrapperGenerationAttribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If yyyAssembly is `netstandard`, you need to switch the Api Compatible Level in
Otherwise, it is because this generation depends on the trimmed aot dll, and the aot dll has not been generated at this time. There are several reasons for this result:

- You have never used the code related to the dll in the main project, so even if it is retained in the link.xml, it is still completely clipped. The solution is to randomly write a piece of code in the main project to reference a certain class or function in the dll.
- Unity2021 version, packaging iOS platform, using com.code-philosophy.hybridclr version lower than 2.0.1, and not modifying the UnityEditor.CoreModule.dll file, resulting in not getting the trimmed dll. The solution is to upgrade hybridclr_unity to version 2.0.1 or higher or modify UnityEditor.CoreModule.dll according to the document [Modify Unity Editor-related dll](/hybridclr/modify_unity_dll/).
- Unity2021 version, packaging iOS platform, using com.code-philosophy.hybridclr version lower than 2.0.1, and not modifying the UnityEditor.CoreModule.dll file, resulting in not getting the trimmed dll. The solution is to upgrade hybridclr_unity to version 2.0.1 or higher or modify UnityEditor.CoreModule.dll according to the document [Modify Unity Editor-related dll](../advanced/modifyunitydll.md).
- other reasons. The universal solution is to manually build a project to generate aot dll.

### A `NullReferenceException.HybridCLR.Editor.ABI.TypeCreatorBase.CreateTypeInfo...` occurred while running `HybridCLR/generate/xxx`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ Thanks to these friends for their generous sponsorship! ! !
- 流星语传媒 [github](https://github.com/ChineseGod)
- 光辉 [github](https://github.com/guanghui1987)
- 光头佬(485925113)
- han [github](170487453@qq.com)
- han 170487453@qq.com
- 鲶巴啷 (657542753)

0 comments on commit 43d2415

Please sign in to comment.