- Home /
Admob C# Script isn't running whatsoever.
Ok, so i'm trying to add a small ad to my game with google's admob. I donwloaded all i had to download, and the demo worked perfectly. However, when i try to adapt the code to my game, the c# script doesn't even run. I aded a debug log in the start function, but it's not showing up in the log. Alsno, i'm trying to access a JS variable from a C# script. I placed the JS in the standard assets so it compiles first and i would be able to get to the variable. Dont know it that makes any difference though.. Here's a bit of the code (Start and Update)
EDIT 1: The script IS atached to a game obect. In fact the same object the other JS is attached to.
 using System;
  using UnityEngine;
  using GoogleMobileAds;
  using GoogleMobileAds.Api;
  // Example script showing how to invoke the Google Mobile Ads Unity plugin.
  public class AdManager : MonoBehaviour
  {
      bool shown = false;
      private GameManagerHard jsScript;
      private BannerView bannerView;
      private InterstitialAd interstitial;
  
      void Start()
      {
          RequestBanner();
          jsScript = this.GetComponent<GameManagerHard> ();
          Debug.Log ("start");
      }
      void Update()
      {
          if(jsScript.GO && !shown)
          {
              bannerView.Show();
              shown = true;
              Debug.Log (jsScript.GO);
          }
      }
Your answer
 
 
             Follow this Question
Related Questions
I can't get variable to decrease by one 1 Answer
Admob interstitial showing using listener 1 Answer
Admob Banner Ads not shown but are clickable 1 Answer
admob Ads not showing with original package name 4 Answers
Admob ads are showing 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                