how to detect which unity version is used at runtime

Hello,

I'd like to know if it's possible to detect at runtime which version of unity my code is running in (Free or Pro). I'm writing a .net library (not especially targeted at unity) which can sometimes make native calls (using pinvokes). So I'd like to avoid making those calls when running unity free (which would crash stuff).

one option I thought of was using the same system used to detect if you're running mono. Trying to load a specific class at runtime that would only be available in the given context

example (from mono's website)

        Type t = Type.GetType ("Mono.Runtime");
    if (t != null)
         Console.WriteLine ("You are running with the Mono VM");
    else
         Console.WriteLine ("You are running something else");

but I don't know if there are classes that are only available in pro that I could use for such test.

thanks.

is `Application.unityVersion` what you're looking for?