Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Platform Dependent Compilation for WebGL?

Discussion in 'Unity 5 Pre-order Beta' started by jsleek, Dec 5, 2014.

  1. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    I want to run code that only is activated for WebGL, the same way you would only run code on Android ( #IF UNITY_ANDROID).

    Does #IF UNITY_WEBGL exist or an equivalent to it exist?

    Cheers.
     
    tomekkie2 likes this.
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Yes. (And thanks for reminding me, I'll add it to the docs!).
     
  3. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    tomekkie2 likes this.