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.

Question Exclude Script From Build

Discussion in 'Editor & General Support' started by QuebecDev, May 28, 2023.

  1. QuebecDev

    QuebecDev

    Joined:
    May 9, 2020
    Posts:
    37
    Hi,

    Is there a way to exclude a script from a build? except those way:
    - #if UNITY_2022 # endif
    - Moving the script file to Editor folder.
    - Using an Assembly definition.

    This guy manage to do it but I don't know how :/
    https://forum.unity.com/threads/exclude-files-objects-components-from-build.1287671/

    I am hoping for a magical Asset.Flag = Hidden or a static List<Asset> assetToExludeAtBuild :D

    Edit:
    I think I can do that using BuildPipeline...
     
    Last edited: May 28, 2023
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    That's easy to fix! Buy his product!
     
  3. QuebecDev

    QuebecDev

    Joined:
    May 9, 2020
    Posts:
    37
    Bump.