- Home /
Question by
JannickL · Feb 14, 2017 at 05:43 PM ·
scripting problemplatform
Get current platform
How can i get the current platform? I wont to execute some code only on windows and not on android (building an .apk and a .exe). Something like:
if (isWindows)
someCode();
else
return;
Comment
Best Answer
Answer by oStaiko · Feb 14, 2017 at 05:51 PM
It's pretty easy!
#if UNITY_EDITOR
someCode ();
#elif UNITY_ANDROID
someCode ();
#elif UNITY_IOS
someCode ();
#elif UNITY_STANDALONE_OSX
someCode ();
#elif UNITY_STANDALONE_WIN
someCode ();
#endif