deahtAds script:
public int death;
private static readonly Dictionary <String, String> REVMOB_APP_IDS = new Dictionary <String, String>() {
}
};
private RevMob revmob;
private RevMobFullscreen fullscreen;
// Use this for initialization
void Awake () {
DontDestroyOnLoad (this);
revmob = RevMob.Start(REVMOB_APP_IDS, "Ads");
}
void Start(){
#if UNITY_ANDROID
RevMobBanner banner = revmob.CreateBanner(RevMob.Position.BOTTOM, 0, 0, Screen.width, 100);
banner.Show ();
#elif UNITY_IPHONE
banner = revmob.CreateBanner(0, 0, 350, 50, null, null);
banner.Show();
#endif
}
// Update is called once per frame
void Update () {
Debug.Log (death);
if (death > 2) {
death = 0;
revmob.ShowFullscreen();
}
}
}
and in my main character script, when the player dies it supposed to add + 1 to public int death, and when gets to 3 show an ad and reset itself.
this is how i add:
deathscript.death += 1;
in awake function im getting the script deathAds.
even tho im using dontdestroyonload, it still does destroy it, and begins the count all over again.