public void RemoveMeChip(VKObjectPoolManager vkPool, Transform tranTarget, Transform tranWorld, bool isAnim = true) { if (isAnim) { foreach (var chip in xMeChips) { chip.transform.SetParent(tranWorld); LeanTween.move(chip.gameObject, tranTarget.position, 0.2f).setOnComplete(() => { LeanTween.cancel(chip.gameObject); vkPool.GiveBackObject(chip.gameObject); }); } } else { foreach (var chip in xMeChips) { LeanTween.cancel(chip.gameObject); vkPool.GiveBackObject(chip.gameObject); } } xMeChips.Clear(); meBetValue = 0; txtBetMe.SetNumber(meBetOld); txtBetMe.txtNumber.color = cMeBets[0]; }
public void RemoveChip(VKObjectPoolManager vkPool, List <UIBauCuaChip> uiChips, Transform tranWorld, bool isAnim = true) { if (isAnim) { foreach (BauCuaChip chip in bcChips) { chip.transform.SetParent(tranWorld); LeanTween.move(chip.gameObject, uiChips[chip.indexUiChip].transform.position, 0.2f).setOnComplete(() => { vkPool.GiveBackObject(chip.gameObject); }); } } else { foreach (BauCuaChip chip in bcChips) { vkPool.GiveBackObject(chip.gameObject); } } bcChips.Clear(); meBetValue = 0; txtBetMe.text = VKCommon.ConvertStringMoney(meBetOld); txtBetMe.color = cMeBets[0]; }
public void RemoveMeChip(VKObjectPoolManager vkPool) { foreach (var chip in xMeChips) { LeanTween.cancel(chip.gameObject); vkPool.GiveBackObject(chip.gameObject); } xMeChips.Clear(); }
public void AddMeChip(VKObjectPoolManager vkPool, XocXocChip chip, Transform tranStart, Transform tranWorld, double value) { if (xMeChips.Count >= maxMeChip) { vkPool.GiveBackObject(xMeChips[0].gameObject); xMeChips.RemoveAt(0); } chip.transform.position = tranStart.position; chip.transform.SetParent(tranWorld); LeanTween.move(chip.gameObject, GetChipPosition(), 0.2f).setOnComplete(() => { chip.transform.SetParent(transChipContent); }); xMeChips.Add(chip); meBetValue += value; txtBetMe.SetNumber(meBetValue + meBetOld); txtBetMe.txtNumber.color = cMeBets[1]; }
public void AddChip(VKObjectPoolManager vkPool, BauCuaChip chip, Transform tranStart, Transform tranWorld, double value) { if (bcChips.Count >= maxChip) { vkPool.GiveBackObject(bcChips[0].gameObject); bcChips.RemoveAt(0); } chip.transform.position = tranStart.position; chip.transform.SetParent(tranWorld); LeanTween.move(chip.gameObject, transform.position + new Vector3(Random.Range(-0.8f, 0.8f), Random.Range(-0.45f, 0.45f), 0f), 0.2f).setOnComplete(() => { chip.transform.SetParent(transform); }); bcChips.Add(chip); meBetValue += value; txtBetMe.text = VKCommon.ConvertStringMoney(meBetValue + meBetOld); txtBetMe.color = cMeBets[1]; }
public void AddAllChip(VKObjectPoolManager vkPool, XocXocChip chip, Transform tranStart, Transform tranWorld) { chip.transform.position = tranStart.position; chip.transform.SetParent(tranWorld); xAllChips.Add(chip); LeanTween.move(chip.gameObject, GetChipPosition(), 0.2f).setOnComplete(() => { chip.transform.SetParent(transChipContent); LeanTween.value(chip.gameObject, (Color color) => { chip.imgChip.color = color; }, new Color(1f, 1f, 1f, 1f), new Color(1f, 1f, 1f, 0f), 0.5f).setDelay(1f).setOnComplete(() => { xAllChips.Remove(chip); LeanTween.cancel(chip.gameObject); vkPool.GiveBackObject(chip.gameObject); }); }); }
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; } } } }
public void GiveBackCard(SamCard card) { vkPoolManager.GiveBackObject(card.gameObject); }
public void RemoveAudio() { isPlay = false; mAudio.clip = null; poolManager.GiveBackObject(gameObject); }