Esempio n. 1
0
 public void ToggleShop()
 {
     if (slot.isIdle)
     {
         shop.Activate();
     }
     else
     {
         assets.audioBeep.Play();
     }
 }
Esempio n. 2
0
        public void ButtonPlayTapped()
        {
            Debug.Log("Round cost: " + slot.gameInfo.roundCost);

            StartCoroutine(DisablePlayButtonFor());

            Quarters.Instance.GetAccountBalance(delegate(User.Account.Balance balance) {
                Quarters.Instance.GetAccountReward(delegate(User.Account.Reward reward) {
                    long availableQuarters = Quarters.Instance.CurrentUser.accounts[0].AvailableQuarters;

                    int spinCost = slot.gameInfo.roundCost;

                    if (spinCost > availableQuarters)
                    {
                        Debug.LogError("Not enough balance");
                        shop.Activate();
                        playBtn.interactable = true;
                        return;
                    }

                    if (slot.state == CustomSlot.State.Idle && !setting.allowDebt && slot.gameInfo.balance < slot.gameInfo.roundCost)
                    {
                        assets.audioBeep.Play();
                        playBtn.interactable = true;
                        Debug.Log("You're out of Quarters. [purchase]");
                        return;
                    }
                    else
                    {
                        //playBtn.interactable = false;
                        //if (Application.isEditor) {
                        //    playBtn.interactable = true;
                        //    slot.Play();
                        //    PlayerPrefs.SetInt("quartersBalance", slot.gameInfo.balance);
                        //}
                        //else {
                        playBtn.interactable = true;
                        SpendQuarters(slot.gameInfo.roundCost, "Pay " + slot.gameInfo.roundCost + " Quarters for round cost.");
                        //}
                    }
                }, delegate(string rewardError) {
                    Debug.LogError(rewardError);
                });
            }, delegate(string error) {
                Debug.LogError(error);
            });
        }