Google AdMob -unable to close Ad
Hi First attempt of trying implement GoogleMobileAds into a unity project. I am getting the warning -> You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all UnityEngine.MonoBehaviour:.ctor () ButtonBehaviour:.ctor () GoogleMobileAds.Unity.BannerClient:CreateButtonBehavior () GoogleMobileAds.Unity.BannerClient:ShowBannerView () GoogleMobileAds.Unity.BannerClient:LoadAd (GoogleMobileAds.Api.AdRequest) GoogleMobileAds.Api.BannerView:LoadAd (GoogleMobileAds.Api.AdRequest)
I have found several responses in various forums and it seems to come down to the incorrect use of "new" in the BannerClient.cs for creating the ad button
I followed the instructions here for the installation - https://developers.google.com/admob/unity/quick-start - but my first issue is that i am unable to import "ALL" in the Import Unity Package Manager- and can only import External Dependencies, therefore presume i cannot access the source code within my project to fix the problem
Installed the latest LST 2021.1.20f1 Google Ad Unity Plugin v6.1.0
Running in the Unity Editor the test ads pop up, also the interstitial ads pop up - but the close button does not trigger a call to HanldeAdOnClosed - therefore the ad never closes and my game does not continue.
I think I need to be able to edit the source code as per this youtube clip - https://www.youtube.com/watch?v=J-C2A__oAp4 - but how do i get to the source code if the package manager is not installing them - it only install the external dependencies (the. dll files)
Your answer
Follow this Question
Related Questions
C# Import local package from menu 0 Answers
[Daydream][C#]How would I make a simple directional controller with Google Daydream Controller? 1 Answer
GoogleVR / C# - How to, with the "pointer click": click 1 move a cube and click 2 move back the cube 0 Answers
How do I set a query value from firestore to a text field? 0 Answers