void Start()
    {
        // Set level text
        levelText.text = "Level " + GamePersistence.gameData.level;
        // Did we win the level ?
        if (GameController.hasWon)
        {
            // Change texts
            resultText.text = "PASS!";
            hintText.text   = "NEXT LEVEL ...";
            // Change text colors
            resultText.color = hintText.color = GameController.WIN_COLOR;
            // Hide skip level button
            skipLevelButton.gameObject.SetActive(false);
        }
        else
        {
            // Check if we need to show the skip level button
            bool visible = GameController.levelAttempts >= SKIP_LEVEL_ATTEMPS && GamePersistence.gameData.level == GamePersistence.gameData.highestLevel &&
                           AdsController.IsRewardedVideoAdLoaded();

            skipLevelButton.gameObject.SetActive(visible);
        }
        // Increase the games played count
        gamesPlayedSinceStart++;
        // Show ads
        if (gamesPlayedSinceStart % GAMES_TO_SHOW_INTERSTITIAL_AD == 0)
        {
            AdsController.ShowInterstitialAd();
        }

        // Show banner ad
        AdsController.ShowBannerAd();
    }
Exemple #2
0
 void Start()
 {
     // Load the game
     GamePersistence.Load();
     //GamePersistence.gameData.highestLevel = LevelManager.levels.Length;
     // Set the level text
     levelText.text = "Level " + GamePersistence.gameData.level;
     // Initialize ads
     AdsController.Initialize();
     // Show banner ad
     AdsController.ShowBannerAd();
 }
 void Start()
 {
     // Load data
     GamePersistence.Load();
     // Initialize GPGS
     GPGSController.Initialize();
     // Initialize ads
     AdsController.Initialize();
     // Display the banner ad
     AdsController.ShowBannerAd();
     // Change the sound button image accordingly
     soundButtonImage.sprite = GamePersistence.gameData.muted ? soundOffSprite : soundOnSprite;
     // Disable GPGS login is necessary
     if (GamePersistence.gameData.gpgsLogin)
     {
         gpgsLoginButton.gameObject.SetActive(false);
     }
 }