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. Dismiss Notice

Confused between using the plugin and the service

Discussion in 'Unity Ads & User Acquisition' started by arkon, Jul 3, 2016.

  1. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I had previously installed the Unity Ads plugin, integrated the code into my game then added the game to the Unity Ads Dashboard. This gave me 2 Game ID's. BUT I just discovered the services tab in Unity had a button to enable the Ads service so I clicked it and enabled the game for Ads in the editor. This has given me 2 new Game ID's which are different to the ones I had before.

    So I went to the dashboard at UnityAds and now my game shows up twice, once at the top of the screen with the 2 old IDS and now again under the heading Unity5.2 Games with 2 different Game IDS.

    So in my code where I call Advertisement.Initialize(UnityADS_IOS); what ID do I use?

    To make maters worse I now have an error in unity that says this:
    Code (CSharp):
    1. Assets/Scripts/GameScene/Adverts.cs(90,9): error CS0433: The imported type `UnityEngine.Advertisements.Advertisement' is defined multiple times
    What the heck is going on?
     
  2. Deleted User

    Deleted User

    Guest

    Unity Ads is now integrated into the engine itself and you no longer require a plugin. You can even remove the initialization code.
     
  3. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Is there any documentation for how to do this? All the docs I can find still mention having to install a plugin by getting Unity Ads 2.0 Beta from a github. Do I just delete the exisiting plugin and enable the service?
     
  4. Deleted User

    Deleted User

    Guest

    I am not really sure about the 2.0 beta. I guess for the beta you just disable the service in the engine, add the plugin and initialize with the game id provided in your dashboard. I may be wrong though.
     
  5. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I've removed the plugin, restarted unity and enabled the ads service, but now I get everywhere in code that I use Advertisement.something the word Advertisement is highlighted and the message when I hover over the word is that Advertisement is defined multiple times.

    Code (CSharp):
    1. The type 'Advertisement' exists in both 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' [Assembly-CSharp]
    2. The type 'Advertisement' exists in both 'Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' [Assembly-CSharp]
    3. UnityEngine.Advertisements.Advertisement
    *Edit. I found the problem but will leave this here incase it helps anyone else. Unity Ads plugin has stuff in both Plugins, Editor AND Standard assets folder, Id deleted everything in plugins but not Standard Assets.
     
    Last edited: Jul 3, 2016
  6. Akheerstudio

    Akheerstudio

    Joined:
    Dec 1, 2017
    Posts:
    3
    Thanks buddy :)
     
  7. SonicTheHedgiehog

    SonicTheHedgiehog

    Joined:
    Nov 15, 2020
    Posts:
    20
    Similar problem after importing itween and itween visual editor. i deleted the plugins folder and the problem fixed. Thanks arkon!