So I import Chartboost and it's working in the device it displays ads. But I had a problem when touch goes through impressions so I tried to listen to the correct events and disable touch when an ad is visible. It works the first time but when I reload the scene ads display but events are not working.
I have my scene like this:
-SplashScreen: Here is where I have my Chartboost Gameobject with don't destroy and my Chartboost script with display ads and events.
-Main Menu + Level: First time I load this scene after SplashScreen events work but when I touch a go to main menu button to reload this scene it's not working.
This is how I subcribe/unsubscribe to events:
void OnEnable(){
Chartboost.didDismissInterstitial += didDismissInterstitial;
Chartboost.didCloseInterstitial += didCloseInterstitial;
Chartboost.didClickInterstitial += didClickInterstitial;
Chartboost.didDisplayInterstitial += didDisplayInterstitial;
}
void didDismissInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didDismissInterstitial -= didDismissInterstitial;
}
void didCloseInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didCloseInterstitial -= didCloseInterstitial;
}
void didClickInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didClickInterstitial -= didClickInterstitial;
}
void didDisplayInterstitial(CBLocation location){
Input.UseTouch = false;
Time.timeScale = 0;
Chartboost.didDisplayInterstitial -= didDisplayInterstitial;
}
↧