unity3d - Showing/Hiding Banners in Unity 5.1 and AdMob plugin 2.3 after some time won't hide banner or even load it, any idea why? -
i integrated admob in unity project banners supposed displayed @ menu , game on screen. problem after time banner ether wont hide more or stops showing up.
here code requesting , showing/hiding banners:
bool bannertrigger = false; public float bannerrequesttimeout; float bannerrequestedtime; float bannersakrivanjevreme; void start(){ requestbanner(); bannerrequestedtime = time.time; } void update(){ if (time.time > bannerrequestedtime + bannerrequesttimeout) { requestbanner (); bannerrequestedtime = time.time; } if ((gamecontroller.pause || gamecontroller.gameover !=0) && !bannertrigger) { bannerview.show (); bannertrigger = true; debug.log (bannertrigger); } if (!gamecontroller.pause && gamecontroller.gameover == 0 && bannertrigger) { bannerview.hide(); bannertrigger = false; debug.log (bannertrigger); } }
}
debug log shows if statements works supposed do, problem somewhere in bannerview.show() , bannerview.hide() have no idea anymore. doing wrong?
gamecontroller.pause bool (true if paused) gamecontroller.gameover int (!= 0 if game over)
Comments
Post a Comment