Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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:
    36,120
    That's easy to fix! Buy his product!
     
  3. QuebecDev

    QuebecDev

    Joined:
    May 9, 2020
    Posts:
    37
    Bump.