Example #1
0
        //inizializzo la carta con i valori e le immagini corrette
        public void Init(Statics.Suit suit, int number, bool frontSide)
        {
            this.suit   = suit;
            this.number = number;
            SetSide(frontSide);

            foreach (Transform t in transform)
            {
                switch (t.name)
                {
                case "Big Suit":
                    imageBigSuit = t.GetComponent <Image>();
                    break;

                case "Small Suit":
                    imageSmallSuit = t.GetComponent <Image>();
                    break;

                case "Number":
                    imageNumber = t.GetComponent <Image>();
                    break;

                default:
                    break;
                }
            }
            this.canvasGroup = GetComponent <CanvasGroup>();

            InitSprites();
        }
Example #2
0
        public Sprite GetSuitSpriteFromSuit(Statics.Suit suit)
        {
            Sprite sprite;

            if (suitSprites.TryGetValue(suit, out sprite))
            {
                return(sprite);
            }
            return(null);
        }
Example #3
0
 public CardState(Card card)
 {
     this.suit      = card.suit;
     this.number    = card.number;
     this.frontSide = card.frontSide;
 }