public void EndGameUI() { if (SaveAndLoadGameData.instance.savedData.playedGameCount % 2 == 0 && SaveAndLoadGameData.instance.savedData.isAdsRemoved == false) { FindObjectOfType <AdmobManager>().ShowInterstitialAd(); } pauseButton.gameObject.SetActive(false); gameEndedGroup.SetActive(true); totalCoinText.text = (SaveAndLoadGameData.instance.savedData.coin - survivalManager.GetCoinGained()).ToString(); CallCoinEnumerator(); }
/// <summary> /// Update is called every frame, if the MonoBehaviour is enabled. /// </summary> void Update() { if (isAdClosed) { if (isRewarded) { manager.GainCoin(manager.GetCoinGained()); x2Text.gameObject.SetActive(true); rewardedVideoButton.gameObject.SetActive(false); Debug.Log("rewarded"); // do all the actions // reward the player isRewarded = false; } else { // Ad closed but user skipped ads, so no reward // Ad your action here } isAdClosed = false; // to make sure this action will happen only once. } }