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; } }
void initDailyGiftCountdown(PPTuning tuning, PPDataController dataController) { float dailyGiftCountdown; bool redeemOnTimerReset = false; if (dataController.DailyGiftCountdownRunning && !overrideTimerForDebugging) { dailyGiftCountdown = dataController.DailyGiftCountdown; } else { dailyGiftCountdown = tuning.WaitTimeSecsForDailyGift; redeemOnTimerReset = true; } dailyGiftTimer = new PPTimer(dailyGiftCountdown, tuning.DefaultTimerTimeStepSec); giftTimerDisplay.SetText(dailyGiftTimer.TimeRemainingStr); if (dataController.HasGiftToRedeem || redeemOnTimerReset) { makeDailyGiftAvailableToRedeem(); } else { startGiftTimer(); } }
public CoinsAdReward() { gameController = PPGameController.GetInstance; PPTuning tuning = gameController.Tuning; this.amount = tuning.VideoAdCoinBonus; rewardSFXEvent = k.GIFT_REDEEM; }
// Use this for initialization protected override void setReferences() { base.setReferences(); wanderCenter = GetComponent <RectTransform>().anchoredPosition; target = GetComponent <RectTransform>().anchoredPosition; setupDecisionRoutine(); PPTuning tuning = PPGameController.GetInstance.Tuning; tapToHeart = tuning.TapToHeart; dogSpeed = tuning.DogSpeed; minTimePerState = tuning.MinDogStateTime; maxTimePerState = tuning.MaxDogStateTime; }
protected override void setReferences() { base.setReferences(); if (isSingleton) { dogDatabase = parseDogDatabase(); shop = parseShopDatabase(); gifts = parseGiftDatabase(); tuning = parseTuning(); languages = initLanguages(); shop.Initialize(); gifts.Initialize(); } }
public void Init(PPTuning tuning) { this.tuning = tuning; defaultReturnChances = new WeightedRandomBuffer <CurrencyType>( new CurrencyType[] { CurrencyType.Coins, CurrencyType.DogFood, }, new float[] { tuning.DefaultChanceOfCollectingMoney, tuning.DefaultChanceOfCollectingDogFood, } ); giftChances = populateGifts( tuning.DailyGiftOptions, tuning.DailyGiftAmounts, tuning.DailyGiftWeights, tuning.DailyGiftDiscountAmount); giftFactory = new CurrencyFactory(); }
protected override void fetchReferences() { base.fetchReferences(); tuning = gameController.Tuning; }
protected override void fetchReferences() { base.fetchReferences(); dataController = PPDataController.GetInstance; tuning = gameController.Tuning; }