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); }
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 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; } } } }