Exemple #1
0
    public void ConfirmCatPurchase(Cat cat)
    {
        /*
         *  Buy <catType> for <X> gold?
         *  Yes     No
         */

        if (cat.getCatAsset().price > GameControl.control.playerData.gold)
        {
            GameControl.control.NotEnoughGoldPrompt(GameControl.control.transform);
            return;
        }
        GameControl.control.YesNoPrompt(LanguageSupport.BuyPrompt(cat.Name,
                                                                  CatIAP.goldStr + cat.getCatAsset().price.ToString()), GameControl.control.transform,
                                        () =>
        {
            GameControl.control.checkDeckAvailability(GameControl.control.transform,
                                                      (bool deckAvailable) =>
            {
                if (deckAvailable)
                {
                    buyCat(cat);
                }
            });
        }).RewardBackground();
    }