Пример #1
0
    private void AutoBet(Dictionary <int, int> dictChips, UIBauCuaGate uiGate)
    {
        int count = 0;

        foreach (var item in dictChips)
        {
            if (count >= uiGate.maxChip)
            {
                return;
            }

            for (int i = 0; i < item.Value; i++)
            {
                count++;

                BauCuaChip bcChip = vkChipPool.BorrowObject <BauCuaChip>();
                bcChip.SetChip(sprChips[item.Key], VKCommon.ConvertSubMoneyString(uiChips[item.Key].money), item.Key, _baucua.moneyType);

                uiGate.AddChip(vkChipPool, bcChip, uiChips[item.Key].transform, tranWorld, uiChips[item.Key].money);
                if (count >= uiGate.maxChip)
                {
                    return;
                }
            }
        }
    }
Пример #2
0
    public void ButtonGateClickListener(UIBauCuaGate uiGate)
    {
        if (_baucua.session.State != BauCuaState.BETTING)
        {
            AudioAssistant.Instance.PlaySoundGame(_GAMEID, _SFAIL);
            SetNoti("Đã hết thời gian đặt cược");
            return;
        }

        if (_account.GetCurrentBalance(_baucua.moneyType) < GetTotalBetValue() + uiChipSelected.money)
        {
            AudioAssistant.Instance.PlaySoundGame(_GAMEID, _SFAIL);
            SetNoti("Số dư của bạn không đủ");
            return;
        }

        AudioAssistant.Instance.PlaySoundGame(_GAMEID, _SCOIN);
        BauCuaChip bcChip = vkChipPool.BorrowObject <BauCuaChip>();

        bcChip.SetChip(sprChips[uiChipSelected.index], VKCommon.ConvertSubMoneyString(uiChipSelected.money), uiChipSelected.index, _baucua.moneyType);

        uiGate.AddChip(vkChipPool, bcChip, uiChipSelected.transform, tranWorld, uiChipSelected.money);
    }