How to prevent stripping OcclusionCullingData type when using IL2CPP?

Hi. I found that when I used OcclusionCulling only scenes in AssetBundle, it shows “Could not produce class with ID 363” error in player build. After investigating, class ID 363 means “OcclusionCullingData” type.

How to prevent IL2CPP stripping for that type?

I tried this link.xml but not works:

(I used reflection and UnityType class for getting above information. It’s module name is “Umbra” and namespace is empty.)

Any ideas?
Thanks.

The link.xml file won’t work in this case. It is used to preserve managed code, but OcclusionCulling is a native code engine type.

I think that you have two options:

1 Like

It seems that both 1 and 2 are not suitable for my case. My project is composite of two separated parts (client only build and assetbundle only build).

I found that adding very small scene (1 renderer + OC) to client can solve this issue.

That works as well!