AssetStore版のUnity Adsを使おうとすると、こんなコンパイルエラーに遭遇することがあります。
By the way, the compiler shows compile error with the message that is "Assets/Example.cs(8,9): error CS0433: The imported type `UnityEngine.Advertisements.Advertisement' is defined multiple times".
で、これの原因は「Unity EditorビルドインのUnity Ads」と「Asset Storeから入れたUnity Ads」とで衝突を起こしているからです。これを抑制するためには、ビルドインのUnity AdsをオフにしてあげればOKです。
詳細は、Unity Technologies Japanの「Unity Ads導入時に「The imported type `UnityEngine.Advertisements.Advertisement' is defined multiple times」というエラーが表示される」を見てください。
で、普通は↑の通りやればコンパイルエラーは解消するんですが「2017.4.2f2
」だとどうやら、ビルドインのUnity Adsをオフにしてもコンパイルエラーのままでダメっぽいです。
自分の手元で最小構成でも再現したし、UnityのIssue Trackerにこんなのがありました。
残念ながら、より新しいLTSの2017.4.3f1
でも修正されなかったぽいです。
本稿執筆時には、Issueは「Fix in review」ってステータスなので、もうちょい待ちましょうか。