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
    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();
        }
    }
Example #3
0
    public CoinsAdReward()
    {
        gameController = PPGameController.GetInstance;
        PPTuning tuning = gameController.Tuning;

        this.amount    = tuning.VideoAdCoinBonus;
        rewardSFXEvent = k.GIFT_REDEEM;
    }
Example #4
0
    // 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;
    }
Example #5
0
 protected override void setReferences()
 {
     base.setReferences();
     if (isSingleton)
     {
         dogDatabase = parseDogDatabase();
         shop        = parseShopDatabase();
         gifts       = parseGiftDatabase();
         tuning      = parseTuning();
         languages   = initLanguages();
         shop.Initialize();
         gifts.Initialize();
     }
 }
Example #6
0
 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;
 }
Example #8
0
 protected override void fetchReferences()
 {
     base.fetchReferences();
     dataController = PPDataController.GetInstance;
     tuning         = gameController.Tuning;
 }