Example #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;
                }
            }
        }
    }
Example #2
0
    public void ButtonGateClickListener(UIXocXocGate uiGate)
    {
        if (_xocxoc.IsDealer())
        {
            return;
        }

        if (_xocxoc.session.CurrentState != XocXocGameState.BETTING)
        {
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonFail);
            SetNotify("Chưa đến thời gian đặt cược");
            return;
        }

        if (_account.GetCurrentBalance(_xocxoc.moneyType) < GetTotalBetValue() + uiChipSelected.money)
        {
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonFail);
            SetNotify("Số dư của bạn không đủ");
            return;
        }

        AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioNemCoin);
        XocXocChip xChip = vkChipPool.BorrowObject <XocXocChip>();

        xChip.SetChip(sprChips[uiChipSelected.index], VKCommon.ConvertSubMoneyString(uiChipSelected.money), uiChipSelected.index);

        uiGate.AddMeChip(vkChipPool, xChip, imgMyAvatar.transform, transWorld, uiChipSelected.money);
    }
Example #3
0
    private void PlayerAutoBet(Dictionary <int, int> dictChips, UIXocXocGate uiGate, Transform transStart)
    {
        int count = 0;

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

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

                XocXocChip xChip = vkChipPool.BorrowObject <XocXocChip>();
                xChip.SetChip(sprChips[item.Key], VKCommon.ConvertSubMoneyString(uiChips[item.Key].money), item.Key);

                uiGate.AddAllChip(vkChipPool, xChip, transStart, transWorld);
                if (count >= uiGate.maxPlayerChip)
                {
                    return;
                }
            }
        }
    }
 private void SetupBetOption()
 {
     for (int i = 0; i < bets.Count; i++)
     {
         Toggle btnBet = bets[i];
         btnBet.isOn = false;
         Text title = btnBet.GetComponentInChildren <Text>(true);
         int  value = (int)((float)(_bacayData.MaxBet - _bacayData.MinBet) / (bets.Count - 1) * i + _bacayData.MinBet);
         title.text = VKCommon.ConvertSubMoneyString(value);
         btnBet.onValueChanged.AddListener((isOn) =>
         {
             AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioButtonClick);
             if (isOn)
             {
                 betSelected = value;
             }
         });
     }
 }
Example #5
0
 private void ShowText(double num)
 {
     if (txtNumber != null)
     {
         if (isMoney)
         {
             if (isSubMoney && num >= subMoneyMinValue)
             {
                 txtNumber.text = VKCommon.ConvertSubMoneyString(num);
             }
             else
             {
                 txtNumber.text = VKCommon.ConvertStringMoney(num);
             }
         }
         else
         {
             txtNumber.text = num.ToString();
         }
     }
 }
Example #6
0
    private void MoveWinAuto(Dictionary <int, int> dictChips, UIXocXocGate uiGate, Transform target)
    {
        int count = 0;

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

            for (int i = 0; i < item.Value; i++)
            {
                count++;
                XocXocChip xChip = vkChipPool.BorrowObject <XocXocChip>();
                xChip.SetChip(sprChips[item.Key], VKCommon.ConvertSubMoneyString(uiChips[item.Key].money), item.Key);
                xChip.imgChip.color = new Color(1f, 1f, 1f, 0f);

                xChip.transform.position = uiGate.GetChipPosition();
                xChip.transform.SetParent(transWorld);

                LeanTween.value(xChip.gameObject, (Color color) =>
                {
                    xChip.imgChip.color = color;
                }, new Color(1f, 1f, 1f, 0f), new Color(1f, 1f, 1f, 1f), 0.5f).setOnComplete(() => {
                    LeanTween.move(xChip.gameObject, target.position, 0.4f).setDelay(0.1f).setOnComplete(() => {
                        LeanTween.cancel(xChip.gameObject);
                        vkChipPool.GiveBackObject(xChip.gameObject);
                    });
                });

                if (count >= uiGate.maxMeChip)
                {
                    return;
                }
            }
        }
    }
Example #7
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);
    }
Example #8
0
 public void ShowBet(long balance, int amount)
 {
     SetPlayerMoney(balance);
     betAmount.text = "Cược: " + VKCommon.ConvertSubMoneyString(amount);
 }