Does anyone know why UNITY_WEBPLAYER would evaluate to true while running in the editor? Is there another way for the build to detect that it is or isn’t a web player? Thanks!
What you are using are compiler switches. They are some kind of constants to tell the compiler at compile time which code it should use. This is "selected" by the target platform you're actually using. If you switch the platform to standalone for example it would ignore the UNITYWEBPLAYER stuff. UNITYEDITOR is a special switch which is only active when Unity creates the temp-build to run inside the editor.