Search Unity

[Question] Are package contents always included in build even if not used?

Discussion in 'Package Manager' started by Say-Chimp, Jan 24, 2020.

  1. Say-Chimp

    Say-Chimp

    Joined:
    Jul 16, 2019
    Posts:
    17
    I did a quick build and noticed some files that are not used, are included into the build, is this intended?

    Or am i just accidentally referencing it?
     
    Last edited: Jan 24, 2020
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Say-Chimp ,

    Could you be more specific? What files are you referring too?

    Regards,

    Pascal
     
  3. Say-Chimp

    Say-Chimp

    Joined:
    Jul 16, 2019
    Posts:
    17
    For example, if i include a prefab in the package, under the runtime folder.
    But the prefab is not used in any of the scene.

    Will it be added into the build as well?
     
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
  5. Say-Chimp

    Say-Chimp

    Joined:
    Jul 16, 2019
    Posts:
    17
    upload_2020-4-8_9-13-47.png

    Nope just the regular folder, following this structure, i just have a prefab in the Runtime folder
     
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Oh, I see, you are talking about code :) Maybe this documentation page will help you understand how Unity is stripping managed code in build and what you can do to tweak the process to your need? Everything in this document applies to sources in packages.

    If you need more info, don't' hesitate to reply here or open a new question in the scripting forum.

    Regards,

    Pascal