private void Start() { slowmotionClass = slowmotion.GetComponent <Slowmotion>(); playerClass = player.GetComponent <Player>(); playerActionsClass = player.GetComponent <PlayerActions>(); coinsAcquiredOnScreenText = coinsAcquired.GetComponent <TextMeshProUGUI>(); coinsInScene = FindObjectsOfType <Coin>().Length; coinsAcquiredOnScreenText.text = currentCoinsAcquired.ToString() + " / " + coinsInScene; playerStats = FindObjectOfType <PlayerStatistics>(); taskHandler = FindObjectOfType <TaskHandler>(); prevLowerBound = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, 0)).y; playSpaceCollider = playSpace.GetComponent <PolygonCollider2D>(); gameLinesClass = gameLines.GetComponent <GameLines>(); levelCompletedText = levelCompletedTextGO.GetComponent <TextMeshProUGUI>(); PersistentInformation.LevelIdentifier = gameObject.scene.name; pg = FindObjectOfType <ProceduralGeneration>(); initialTimeForAdButtonAnimation = timeForAdButtonAnimation; adMobClass = FindObjectOfType <AdMob>(); adMobClass.RequestRewardBasedVideo(); adMobClass.RequestInterstitial(); }
public static void Request(Segment segment, System.Action <bool> callback = null) { if (OnPreRequest(segment) == false) { return; } var zone = segment.ZoneId; Debug.Log("FunAd.Interstitial.Request: " + zone); if (zone.IsNullOrEmpty()) { admono.Call(callback, false); return; } if (segment.IsReady) { admono.Call(callback, true); return; } #if ABR || TAPSELL TapsellPlus.RequestInterstitialAd(zone, zoneId => { segment.ResponseZone = zoneId.zoneId; callback?.Invoke(true); OnLoaded?.Invoke(segment); }, error => { Debug.Log("Tapsell.RequestInterstitial.Error: " + error.message); callback?.Invoke(false); OnError?.Invoke(segment); }); #elif UAD UnityAd.Load(zone, success => { if (success) { segment.ResponseZone = zone; callback?.Invoke(true); OnLoaded?.Invoke(segment); } else { OnError?.Invoke(segment); callback?.Invoke(false); } }); #elif ADMOB AdMob.RequestInterstitial(zone, zid => { segment.ResponseZone = zone; callback?.Invoke(true); OnLoaded?.Invoke(segment); }, error => { Debug.Log("AdMob.RequestInterstitial.Error: " + error); callback?.Invoke(false); OnError?.Invoke(segment); }); #else callback?.Invoke(false); #endif }