How can my app know the environment platform on runtime? For example, “Am I running on iPhone? or WebPlayer? or Win32?” Of course, I want to let my app know it on runtime, not compile time. (#if IPHONE something is not what I want to know.)
switch(Application.platform) {
case RuntimePlatform.WindowsPlayer:
// Windows specific code
break;
case RuntimePlatform.WindowsWebPlayer:
// Windows webplayer code
break;
case RuntimePlatform.IPhonePlayer:
// iPhone
break;
case RuntimePlatform.WindowsPlayer:
break;
}
If you want to detect if its WebPlayer (and don’t want to differentiate between MacOS/Windows), you can do
if(Application.isWebplayer) {
// is playing in webplayer
}