unity adsを実装しようと思い、web検索をしながらコードの入力をしていたのですが、
visual studioで、
Error CS0246: The type or namespace name 'ShowResult' could not be found (are you missing a using directive or an assembly reference?) (CS0246) (Assembly-CSharp)
というエラーが表示されました。
なお、unity側のconsoleにはこのエラーは表示されず、普通に実行も出来ます。(実行時にadsの表示も出来ています)
visual studio側の「using UnityEngine.Advertisements;」が半透明色になっており、おそらくVS側がAdvertisementsを認識出来ていないことから起こっているエラーだと思います。
このエラーを解消する方法はありませんか?
###環境
unity 2018.2.15f1
visual studio community 2017 for mac
mac Mojave 10.14.1
unity adsはasset storeからではなく、内部のものを使用しています。
###追記
enable build-in ads extensionのチェック項目を一度外して、再度チェックを付けると、
上記エラーがconsole側にも表示されるようになってしまいました・・・。
解決方法があれば教えていただきたいです。
コードを載せ忘れていたので、コードの方記述しておきますね
C#
1using UnityEngine.Advertisements; 2//・・・ 3public void ButtonClick () { 4 if (Advertisement.IsReady("rewardedVideo")) { 5 var options = new ShowOptions { resultCallback = HandleShowResult }; 6 Advertisement.Show("rewardedVideo", options); 7 } 8} 9public void HandleShowResult ( ShowResult result ) { //ここで上記エラーが出る。 10 switch (result) { 11 case ShowResult.Finished: 12 Debug.Log("The ad was successfully shown."); 13 break; 14 case ShowResult.Skipped: 15 Debug.Log("The ad was skipped before reaching the end."); 16 break; 17 case ShowResult.Failed: 18 Debug.LogError("The ad failed to be shown."); 19 break; 20 } 21 b(); 22} 23//・・・
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。