Search Unity

Unity Ads - not recognizing "using UnityEngine.Advertisements;"

Discussion in 'Scripting' started by Larpushka, Sep 2, 2015.

  1. Larpushka

    Larpushka

    Joined:
    Jan 6, 2015
    Posts:
    214
    So I imported Unity Ads just now, but it doesn't autocomplete

    using UnityEngine.Advertisements;

    And whenI kept going

    Advertisement.Initialize ("11111", true);

    The Advertisement.Initialze appears in red.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.Advertisements; //doesn't autocomplete
    4.  
    5. public class SimpleAds : MonoBehaviour {
    6.  
    7.     void Start () {
    8.         Advertisement.Initialize ("11111", true); //<- and Advertisement.Initialize appears in red. Also doesn't autocomplete.
    9.     }
    10.  
    11. }
     
  2. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Have you switched your platform to either Android or iOS?
     
  3. Larpushka

    Larpushka

    Joined:
    Jan 6, 2015
    Posts:
    214
    Yes, all my build settings have been for android and it's definitely selected as my platform. It has the unity icon and "switch platform" is greyed out for it.
     
  4. Larpushka

    Larpushka

    Joined:
    Jan 6, 2015
    Posts:
    214
    Nevermind, I just needed to restart Unity.