Search Unity

UNITY_ADS Compiler Directive

Discussion in 'Unity Ads & User Acquisition' started by PeachyPixels, Aug 12, 2020.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hello!

    I've installed Unity Ads via the Package Manager (3.4.9) and am trying to use the UNITY_ADS compiler directive as documented here...

    https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

    But to no avail, it's just not recognised. Am guessing it's either a documentation or package issue?

    I know I can define one myself, but having them built into the Unity sub-systems are very handy, so if it's not been defined, please could it be added?
     
    Last edited: Aug 12, 2020
  2. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    Unfortunately the UNITY_ADS compiler directive was removed in a recent version of the SDK.
     
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks Adam, any real reason why?

    It was very useful and means one less thing for us devs to think about.

    UNITY_ANALYTICS is still defined (and equally useful) so there is an inconsistency now.
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Correct, I have had to add UNITY_ADS as "Scripting Define Symbols" in iOS and Android Player Settings for my own game.

    That's at least a workaround. We will bring back the feedback to dev team, thanks.

    /Rasmus
     
    Loader_ and PeachyPixels like this.
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks Rasmus.

    FWIW... I have a framework that travels wholesale (and is improved on) game to game. It incorporates wrappers around a number of third party sub-systems, Unity included.

    Most of these sub-systems have an in-built directive, which means the presence of the package means my framework will just compile (based on what's been imported into the project)

    Basically, they're very useful! To be honest, it would be even better if all Unity's sub-systems included one. e.g. UNITY_REMOTE_CONFIG

    Hope this helps.
     
  6. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    153
    I don't see any mention of this in the changelog