예제 #1
0
        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);
        }
예제 #2
0
        private void CreateTotalChip()
        {
            GameObject  pokerChip = null;
            Transform   tf        = null;
            UIPokerChip script    = null;

            pokerChip = Instantiate(pokerChipsPrefab, Vector3.zero, Quaternion.identity);
            tf        = pokerChip.transform;

            tf.SetParent(pokerChipsParent.transform);
            tf.localPosition = new Vector3(95, -62, 0);
            tf.localScale    = new Vector2(1f, 1f);
            script           = pokerChip.GetComponent <UIPokerChip>();
            pokerChip.SetActive(false);

            totalChip = script;
        }
예제 #3
0
        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);
                }
            });
        }
예제 #4
0
        public void CreateGamePlayeChips()
        {
            GameObject  pokerChip = null;
            Transform   tf        = null;
            UIPokerChip script    = null;

            for (int i = 0; i < RoomModel.MAX_GAME_PLAYER_COUNT; i++)
            {
                pokerChip = Instantiate(pokerChipsPrefab, Vector3.zero, Quaternion.identity);
                tf        = pokerChip.transform;

                tf.SetParent(pokerChipsParent.transform);
                tf.localPosition = Vector2.zero;
                tf.localScale    = new Vector2(1f, 1f);

                script = pokerChip.GetComponent <UIPokerChip>();

                pokerChip.SetActive(false);
                this.pokerChips[i] = script;
            }

            CreateTotalChip();
        }
예제 #5
0
 private void OnCollectAniComplete(UIPokerChip uIPokerChip)
 {
     uIPokerChip.Restore();
     uIPokerChip.gameObject.SetActive(false);
 }