-
Notifications
You must be signed in to change notification settings - Fork 2
Code Stripping
Vladislav Kantaev edited this page Apr 24, 2021
·
5 revisions
Because injection relies on "unused" Construct
methods, there may be problems related to code stripping: with particular stripping settings, these methods may get removed from the final build.
The framework should work with Managed Stripping Level
set to Low
out of the box.
For other levels, there are several options:
- Bake injection: methods will have explicit references to them. However, this is error prone because requires frequent baking to keep things consistent.
- Adding a
link.xml
that prevents the default Unity assembly (Assembly-CSharp
) from getting stripped. If you use assembly definitions in your code, you should create extralink.xml
files to ensure nothing would get stripped. - Marking methods with Unity's built-in
Preserve
attribute. There is a suitable live template for Rider IDE.
In case of any problems related to code stripping, refer to the official manual.