private void OnThrowAniComplete(int chairIndex, Vector2 dest, long amount) { UIPokerChip chip = pokerChips[chairIndex]; chip.gameObject.SetActive(true); chip.transform.localPosition = dest; chip.transform.localScale = new Vector2(1, 1); chip.SetAmount(amount); }
public void CollectChips(long totalBet) { for (int i = 0; i < pokerChips.Length; i++) { if (pokerChips[i].gameObject.activeSelf == true) { UIPokerChip uIPokerChip = pokerChips[i]; uIPokerChip.transform.DOLocalMove(totalChip.transform.localPosition, 0.2f).OnComplete(() => OnCollectAniComplete(uIPokerChip)); } } DOVirtual.DelayedCall(0.1f, () => { if (totalChip != null && totalBet > 0) { totalChip.SetAmount(totalBet); totalChip.gameObject.SetActive(true); } }); }