예제 #1
0
        private void ShowCardResult()
        {
            int[] madeCards = this.model.result.madeCards;

            firstCard.SetAlpha(0.3f);
            secondCard.SetAlpha(0.3f);

            firstCard.transform.localPosition  = new Vector2(firstCard.transform.localPosition.x, firstCard.transform.localPosition.y - 10);
            secondCard.transform.localPosition = new Vector2(secondCard.transform.localPosition.x, secondCard.transform.localPosition.y - 10);


            if (this.model.isWinner == true)
            {
                for (int i = 0; i < madeCards.Length; i++)
                {
                    if (this.model.card1 == madeCards[i])
                    {
                        firstCard.transform.localPosition = new Vector2(firstCard.transform.localPosition.x, firstCard.transform.localPosition.y + 10);
                        firstCard.SetAlpha(1f);
                    }
                    if (this.model.card2 == madeCards[i])
                    {
                        secondCard.transform.localPosition = new Vector2(secondCard.transform.localPosition.x, secondCard.transform.localPosition.y + 10);
                        secondCard.SetAlpha(1f);
                    }
                }
            }
        }
예제 #2
0
        public UICard GetCards(int index)
        {
            if (index < 0 || index > 52 || cards[index] == null)
            {
                throw new System.Exception("인덱스를 넘어감");
            }

            UICard card = cards[index];

            card.transform.localPosition = new Vector3(0, 0, 0);
            card.transform.localScale    = new Vector3(1, 1, 1);
            card.transform.SetParent(this.transform);
            card.gameObject.SetActive(false);
            card.SetAlpha(1);

            return(cards[index]);
        }