unity不同版本的预编译
一:#if UNITY_2017
Debug.Log("unity2017的所有的版本都会走这里");
#endif
二:#if UNITY_2017_2
Debug.LOg("unity2017.2的所有版本都会走这里");
#endif
三:#if UNITY_2017_2_3
Debug.Log("只有unity2017.2.3的版本走这里"):
#endif
四:#if UNITY_2017_2_OR_NEWER
Debug.Log("unity2017.2下面的所有版本(unity2017.2.x),及unity2017.2后面的版本(unity2017.x,x>2)会走这里");
#endif
五:#if UNITY_2017_2_3_OR_NEWER
Debug.Log("unity2017.2.3及unity2017.2后面的版本(unity2017.x,x>2)会走这里");
#endif
六:#if !UNITY_2017_2_3_OR_NEWER
Debug.Log("unity2017.2.3以前的版本会走这里");
#endif
unity不同平台的编译,比较简单,看文档就好
官方文档:
https://docs.unity3d.com/Manual/PlatformDependentCompilation.html