Unity3D define engine version

use in script (c#)


#if UNITY_5_6_OR_NEWER

// engine version 5.6 or higher

#else

#endif

 

use in unity shader


#if UNITY_VERSION >= 560

// engine version 5.6 or higher

// 5.a.b -> 5ab

#else

#endif