Example #1
0
 static void checkStartingValues()
 {
     if (!startingValuesInitialized)
     {
         PPGameController game           = PPGameController.GetInstance;
         bool             initFromTuning = false;
         if (game)
         {
             PPTuning tuning = game.Tuning;
             if (tuning != null)
             {
                 startingCoins   = tuning.StartingCoins;
                 startingDogFood = tuning.StartingDogFood;
                 initFromTuning  = true;
             }
         }
         // Fail safe method in case PPGameControlelr is not initialized yet
         if (!initFromTuning)
         {
             startingCoins   = DEFAULT_COINS;
             startingDogFood = DEFAULT_DOG_FOOD;
         }
         startingValuesInitialized = true;
     }
 }
Example #2
0
    public CoinsAdReward()
    {
        gameController = PPGameController.GetInstance;
        PPTuning tuning = gameController.Tuning;

        this.amount    = tuning.VideoAdCoinBonus;
        rewardSFXEvent = k.GIFT_REDEEM;
    }
Example #3
0
    public void Init(PPGameController gameController, PPDataController dataController, PPGiftController giftController)
    {
        unsubscribeEvents();
        this.giftController = giftController;
        this.dataController = dataController;
        subscribeEvents();

        // Display Updated Currency
        coinsDisplay.Init(dataController.Coins, dataController);
        initDailyGiftCountdown(gameController.Tuning, dataController);
    }
Example #4
0
 protected virtual void fetchReferences()
 {
     this.referencesFetched = true;
     // Check if it has already been initialized, some classes may prefer to use a custom data controller
     if (!this.dataController)
     {
         this.dataController = PPDataController.GetInstance;
     }
     if (!this.gameController)
     {
         this.gameController = PPGameController.GetInstance;
     }
     if (!this.analytics)
     {
         this.analytics = AnalyticsController.Instance;
     }
 }
Example #5
0
 public void SetGame(PPGameController game)
 {
     this.gameController = game;
 }