Ошибка You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed
Появляется ошибка You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. P.S id Admob тестовый.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class InterAd : MonoBehaviour
{
private InterstitialAd interstitialAd;
private string interstitialUnitId = "ca-app-pub-3940256099942544/1033173712";
private void OnEnable()
{
interstitialAd = new InterstitialAd(interstitialUnitId);
AdRequest adRequest = new AdRequest.Builder().Build();
interstitialAd.LoadAd(adRequest);
}
public void ShowAd()
{
if (interstitialAd.IsLoaded())
interstitialAd.Show();
}
}