Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

How to prevent stripping OcclusionCullingData type when using IL2CPP?

Discussion in 'Scripting' started by Kichang-Kim, Aug 28, 2019.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,032
    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.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    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. Disable "Strip Engine Code" in the player settings. This will cause your build size to be larger, but should eliminate this issue.
    2. Use a custom build process to inform the Unity editor about the native engine code types used in your asset bundles. You can see an example of how to do this here: https://bitbucket.org/Unity-Technol...BundleManager/Editor/BuildScript.cs#lines-122
     
    Kichang-Kim likes this.
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,032
    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.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    That works as well!