Editor check if unity pro license installed

I’m writing an editor script that can build asset bundles, or it can build prefabs instead. I know that if I transfer this to a machine that does not have unity pro, it will not compile because I use some functions only available with the pro version. Basically what I wanted was:


// my code…


but that is not an option if you look here:


Would somebody please tell me how I can use conditional compilation to check if unity pro is installed?

For anyone who’s still looking for an answer, this define is now available in Unity 4.5:

Scripting: Added UNITY _ PRO _ LICENSE define.

Basically it should compile because the free version is basically the same version as the Pro version API-wise. There are checks in the code of the Unity internal classes which will simply log a message when calling a function that is Pro-only on Unity Free. Nevertheless you should be able to compile classes that use Unity Pro on Unity Free. You will just not be able to run them. If you want to check in your editor script if the currently run version is Unity Pro use:

bool hasPro = UnityEditorInternal.InternalEditorUtility.HasPro()

And provide a meaningful message in your code should it require Unity Pro but runs on Unity Free.

The only thing I can think of is to make a script that reads the type of license the user has but that would be hard.

I would create a pop up message that asks if you have Unity pro or not and I would add a warning message saying : Warning if you do not own a copy of Unity pro this wont compile as expected.

Unfortunately, I don’t think that is possible.