- Home /
"Application.isWebGL" equivalant?
Is there a way to check if the user is running a WebGL version of my application? Application.isWebPlayer exists, but no webgl, so is there another way to check?
Answer by M-Hanssen · May 09, 2016 at 08:48 AM
use : Application.platform == RuntimePlatform.WebGLPlayer;
Weird, it must not work in 5.3! Unity doesn't recognize it at least. I'll try updating :)
According to http://docs.unity3d.com/ScriptReference/RuntimePlatform.WebGLPlayer.html It should work just fine in Unity 5.3
See link below for all runtime platform detections:
http://docs.unity3d.com/ScriptReference/RuntimePlatform.html
Ah yes, my mistake. Visual Studio had lost connection to the Unity API. I thought this issue was gone... First time it's happened for me in 5.x
Thanks again for the help :)
Answer by Jessespike · May 09, 2016 at 08:50 AM
There's also platform define.
http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
#if UNITY_WEBGL
Debug.Log("WebGL");
#endif
Your answer
Follow this Question
Related Questions
how to check only once when a boolean is always true on update. it keeps looping 2 Answers
Check if object is Rigidbody .js 2 Answers
How to see what level is running? 2 Answers
Check if there is a child with a tag? (multiple children but each diff tag) 1 Answer
Check if two strings are the same 2 Answers