Skip to content

Commit

Permalink
更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
pirunxi committed Dec 15, 2023
1 parent 9d6708f commit 0e82161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/business/reload/hotreloadassembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
- 要求业务代码不会再使用被卸载的Assembly中的对象或者函数,并且退出所有在执行的旧逻辑
- 要求重载的MonoBehaviour中的事件或消息函数如Awake、OnEable之类不发生增删(但函数体可以变化)
- 要求重载后在旧Assembly中存在同名类的MonoBehaviour类的序列化字段名不发生变化(类型可以变)
- 不能直接卸载被依赖的Assembly,必须按照逆依赖顺序先卸载依赖者,再卸载被依赖者。例如A依赖B,则需要先卸载B,再卸载A。
- 由于Unity自身实现的原因,与2022的Jobs不兼容,需要自行小幅修改UnityEngine.CoreModule.dll的代码。 2020-2021仍然可以正常工作
- 不能直接卸载被依赖的Assembly,必须按照逆依赖顺序先卸载依赖者,再卸载被依赖者。例如A.dll依赖B.dll,则需要先卸载A.dll,再卸载B.dll
- 由于Unity自身实现的原因,与2022的Jobs不兼容,需要自行小幅修改UnityEngine.CoreModule.dll的代码。 2020-2021仍然可以正常工作
- 不支持析构函数,~XXX()。也不允许实例化泛型参数带本程序集类型的带析构函数的泛型类

## 一些较佳实践
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The hot reloading technology is used to completely unload or reload an assembly,
- Cannot unload itself in the code of the unloaded assembly.
- It is required that the business code will no longer use the objects or functions in the uninstalled Assembly, and exit all the old logic that is being executed
- It is required that after overloading, in the MonoBehaviour of the same name class in the old Assembly, the functions specially processed by the Unity engine, such as Awake, will not be added or deleted (but the function body can be changed)
- The dependent Assembly cannot be uninstalled directly, the dependent must be uninstalled first and then the dependent must be uninstalled according to the reverse dependency order. For example, if A depends on B, you need to uninstall B first, and then uninstall A.
- Due to Unity's own implementation, it is not compatible with 2022 Jobs, and you need to slightly modify the code of UnityEngine.CoreModule.dll by yourself. 2020-2021 will still work normally.
- Does not support unloading assemblies containing MonoBehaviour or Scriptable scripts. It is temporarily recommended to put it in another aot or hot update assembly that will not be uninstalled, and reference it in the uninstallable assembly.
- The dependent Assembly cannot be uninstalled directly, the dependent must be uninstalled first and then the dependent must be uninstalled according to the reverse dependency order. For example, if A.dll depends on B.dll, you need to uninstall A.dll first, and then uninstall B.dll
- Due to Unity's own implementation, it is not compatible with 2022 Jobs, and you need to slightly modify the code of UnityEngine.CoreModule.dll by yourself. 2020-2021 will still work normally
- Does not support unloading assemblies containing MonoBehaviour or Scriptable scripts. It is temporarily recommended to put it in another aot or hot update assembly that will not be uninstalled, and reference it in the uninstallable assembly
- Destructors, ~XXX() are not supported. It is also not allowed to instantiate a generic class with a destructor with a generic parameter of this assembly type

0 comments on commit 0e82161

Please sign in to comment.