Conditional Compilation (check if under Pro or Indie)

Hi all,

Is there a way to exclude/include parts of scripts from compilation depending on certain conditions met?

Specifically I’d need a way to see if a script is being compiled under the Pro or Indie version of Unity.

cheers.

If you are using C# you can use #define/#if/… preprocesor directives (well, there is no preprocesor in C# but they work very similar).

e.g.

#define K1

// ...

#if K1
  // compile this only if K1 is defined
#else
  // compile this only if K1 is not defined
#endif

Note that the defines should be at the top of the script (remember that there isn’t a real preprocesor).

Don’t know if you can use something similar in Javascript.

Thanks, Diego, this solved it.

As you said though, I also wonder if there’s anything similar in Javascript…