-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 18 additions & 15 deletions
33
.../en/docusaurus-plugin-content-docs/current/business/reload/hotreloadassembly.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# Hotreload Technology | ||
# Hot reload technology | ||
|
||
The hot reloading technology is used to completely unload or reload an assembly, which is suitable for small game collection type games. This solution only provides **commercial version**, please refer to [Introduction to Hot Reload Version](./intro.md) for details. | ||
Hot reload technology is used to completely uninstall or reload an assembly, which is suitable for small game collection type games. This program only provides **commercial version**. | ||
|
||
## Supported features | ||
|
||
- Support unloading assembly | ||
- Support reloading assembly, the code can be changed arbitrarily or even completely different (except MonoBehaviour class) | ||
- Unload 100% of the metadata memory | ||
- Supports uninstalling assembly and uninstalling 100% of the memory occupied by assembly | ||
- Supports reloading the assembly, the code can be changed arbitrarily or even completely different (MonoBehaviour and Scriptable have certain restrictions) | ||
- Supports **limited set of functions that can be accessed in the hot update assembly**, which is suitable for creating a sandbox environment in UGC games to avoid damage caused by malicious player code. | ||
|
||
## Does not support features and special requirements | ||
|
||
## To be implemented, currently unsupported features | ||
- Require business code to no longer use objects or functions in the uninstalled Assembly, and exit all old logic being executed | ||
- The dependent Assembly cannot be uninstalled directly. The dependent Assembly must be uninstalled first, and then the dependent Assembly must be uninstalled in reverse dependency order. For example, if A.dll depends on B.dll, you need to uninstall A.dll first, and then uninstall B.dll. | ||
- MonoBehaviour is related to ScriptableObject | ||
- It is required that the event or message functions in the overloaded MonoBehaviour, such as Awake and OnEable, are not added or deleted (but the function body can be changed) | ||
- It is required that the serialized field name of the script class with the same name in the old Assembly does not change after overloading (the type can be changed) | ||
- Cannot inherit from generic types, such as `class MyScript : CommonScript<int>` | ||
- Some libraries that cache reflection information (this behavior is most common in serialization-related libraries, such as LitJson) need to clear the cached reflection information after hot reloading. | ||
- Destructor, ~XXX() is not supported. It is also not allowed to instantiate a generic class with a destructor that takes a generic parameter of this assembly type. | ||
- Not compatible with dots. Due to the large amount of type information cached by dots, the implementation is complex and it is difficult to clear the cache information alone. | ||
|
||
- Most of the metadata can be released, but Il2CppClass and MethodInfo objects have not been released yet. The follow-up will be perfected soon. | ||
- Support **Limit the collection of functions that can be accessed in the hot update assembly**, suitable for creating a sandbox environment in UGC games to avoid damage caused by malicious player code. | ||
|
||
## does not support features and special requirements | ||
## Some incompatible libraries | ||
|
||
- 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.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 | ||
- 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 | ||
- Jobs in 2022 will cache type-related information, and you need to slightly [modify UnityEngine.CoreModule.dll](./modifydll.md) code yourself. Versions lower than 2022 do not need to be modified | ||
- Deserialization libraries such as LitJson will cache reflection information. It is necessary to clean up the reflection information cached in the library after hot reloading. The specific operation is related to the implementation of the library. |