- Home /
What does UNITY5_SCRIPTING_IN_UNITY4 mean?
What does actually preprocessor directive UNITY5_SCRIPTING_IN_UNITY4
mean?
Answer by Owen-Reynolds · Oct 28, 2015 at 02:50 PM
My guess is that it disallows all the of getter shortcuts that were removed in Unity5. This is in, ummm, 4.62 or above, which came after 5.0 was released?
In Unity5 you have to use the long way, GetComponent<Rigidbody>()
, instead of just rigidbody
. It's probably for if you want to make your possible upgrade to Unity5 smoother (in my limited experience, the auto-converter works pretty well, but conversions tend to miss odd cases. This way is better.)
But what is the point if you cannot put the new calls inside this directive? e.g. this will not compile
#if UNITY5_SCRIPTING_IN_UNITY4
var target = BuildTarget.iOS;
#endif
But that doesn't relate to the getter shortcuts.
Owen is clearly not suggesting that using UNITY5_SCRIPTING_IN_UNITY4 makes every Unity5 scripting change work in Unity4.
Sure, then it's probably just the indicator of unity 4 versions that came after first unity 5 version. Thanks