Мои объявления Admob не отображаются в моем приложении на Android, я перепробовал все, разные версии единства, типы объявлений, переустановку плагина admob, разные комбинации настроек плеера для компиляции Android.
Вход в Unity (я тестировал его на Android):
Пустышка IsLoaded
Пустышка ShowIntertitial
Код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using GoogleMobileAds.Api;
public class ControllerMain : MonoBehaviour
{
public Button LV1, LV2, LV3, LV4, LV5, LV6, LV7, LV8, LV9, LV10;
public int ReturnedVal;
private string MyIdA = "ca-app-pub-3940256099942544/1033173318";
//private InterstitialAd fullscreenad;
//private string FullScreenID = "ca-app-pub-3940256099942544/1033173651";
//private BannerView bannerView;
private InterstitialAd InterFULLSC;
void LOV1() {
SceneManager.LoadScene(1);
}
void LOV2()
{
SceneManager.LoadScene(2);
}
void LOV3()
{
SceneManager.LoadScene(3);
}
void LOV4()
{
SceneManager.LoadScene(4);
}
void LOV5()
{
SceneManager.LoadScene(5);
}
void LOV6()
{
SceneManager.LoadScene(6);
}
void LOV7()
{
SceneManager.LoadScene(7);
}
void LOV8()
{
SceneManager.LoadScene(8);
}
void LOV9()
{
SceneManager.LoadScene(9);
}
void LOV10()
{
SceneManager.LoadScene(10);
}
// Start is called before the first frame update
void Start()
{
MobileAds.Initialize(initStatus => { });
this.InterFULLSC = new InterstitialAd(MyIdA);
//LV1.GetComponent<Image>().color = Color.black;
ReturnedVal = GameMonitor.IsPassed;
if (ReturnedVal > 0)
{
AdRequest requ = new AdRequest.Builder().Build();
this.InterFULLSC.LoadAd(requ);
if (this.InterFULLSC.IsLoaded()) {
this.InterFULLSC.Show();
}
//MobileAds.Initialize(appID);
//go
//bannerView = new BannerView("ca-app-pub-3940256099942544/6300978111", AdSize.Banner, AdPosition.Bottom);
//AdRequest requ = new AdRequest.Builder().Build();
//bannerView.LoadAd(requ);
//bannerView.Show();
//end
//fullscreenad = new InterstitialAd(FullScreenID);
//AdRequest request = new AdRequest.Builder().Build();
//fullscreenad.LoadAd(request);
//if (fullscreenad.IsLoaded())
//{
// fullscreenad.Show();
//}
//else { Debug.Log("Didn't load"); }
}
Debug.Log(ReturnedVal);
LV1.GetComponent<Image>().color = Color.green;
LV2.GetComponent<Image>().color = Color.black;
LV3.GetComponent<Image>().color = Color.black;
LV4.GetComponent<Image>().color = Color.black;
LV5.GetComponent<Image>().color = Color.black;
LV6.GetComponent<Image>().color = Color.black;
LV7.GetComponent<Image>().color = Color.black;
LV8.GetComponent<Image>().color = Color.black;
LV9.GetComponent<Image>().color = Color.black;
LV10.GetComponent<Image>().color = Color.black;
LV2.interactable = false;
LV3.interactable = false;
LV4.interactable = false;
LV5.interactable = false;
LV6.interactable = false;
LV7.interactable = false;
LV8.interactable = false;
LV9.interactable = false;
LV10.interactable = false;
LV1.interactable = true;
LV1.onClick.AddListener(LOV1);
if (ReturnedVal == 2 || ReturnedVal>2) {
LV2.interactable = true;
LV2.GetComponent<Image>().color = Color.green;
LV2.onClick.AddListener(LOV2);
}
if (ReturnedVal == 3 || ReturnedVal > 3)
{
LV3.interactable = true;
LV3.GetComponent<Image>().color = Color.green;
LV3.onClick.AddListener(LOV3);
}
if (ReturnedVal == 4 || ReturnedVal > 4)
{
LV4.interactable = true;
LV4.GetComponent<Image>().color = Color.green;
LV4.onClick.AddListener(LOV4);
}
if (ReturnedVal == 5 || ReturnedVal > 5)
{
LV5.interactable = true;
LV5.GetComponent<Image>().color = Color.green;
LV5.onClick.AddListener(LOV5);
}
if (ReturnedVal == 6 || ReturnedVal > 6)
{
LV6.interactable = true;
LV6.GetComponent<Image>().color = Color.green;
LV6.onClick.AddListener(LOV6);
}
if (ReturnedVal == 7 || ReturnedVal > 7)
{
LV7.interactable = true;
LV7.GetComponent<Image>().color = Color.green;
LV7.onClick.AddListener(LOV7);
}
if (ReturnedVal == 8 || ReturnedVal > 8)
{
LV8.interactable = true;
LV8.GetComponent<Image>().color = Color.green;
LV8.onClick.AddListener(LOV8);
}
if (ReturnedVal == 9 || ReturnedVal > 9)
{
LV9.interactable = true;
LV9.GetComponent<Image>().color = Color.green;
LV9.onClick.AddListener(LOV9);
}
if (ReturnedVal == 10)
{
LV10.interactable = true;
LV10.GetComponent<Image>().color = Color.green;
LV10.onClick.AddListener(LOV10);
}
}
// Update is called once per frame
void Update()
{
}
}