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

Activate/Deactivate script

Discussion in 'Editor & General Support' started by Mike99, Aug 3, 2014.

  1. Mike99

    Mike99

    Joined:
    Dec 11, 2011
    Posts:
    160
    hi,

    is there a way to activate/deactivate scripts depending on if the app is running in the unity editor or when it's builded ?

    thanks,
     
  2. 8BitEdition

    8BitEdition

    Joined:
    Aug 3, 2014
    Posts:
    3
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. ......
    3. #endif
    This will run only for editor in the script. Theoretically you can just disable scripts which would otherwise stay active when built.
     
  3. Mike99

    Mike99

    Joined:
    Dec 11, 2011
    Posts:
    160
    nice thanks,

    where is the doc for those kind of tags ?

    nevermind, found it :)