Ejemplo n.º 1
0
 public static CardSprites getInstance()
 {
     if (instance == null)
     {
         instance = new CardSprites();
     }
     return(instance);
 }
Ejemplo n.º 2
0
        private GameObject createDefaultCard()
        {
            GameObject     card     = GameObject.Find("CardSprite");
            GameObject     new_card = UnityEngine.Object.Instantiate(card);
            SpriteRenderer sr       = new_card.GetComponent <SpriteRenderer>();

            sr.sprite = CardSprites.getInstance().defaultSprite;
            return(new_card);
        }
Ejemplo n.º 3
0
 public Deck()
 {
     cardMap      = new Dictionary <KeyValuePair <Mark, int>, GameObject>();
     defaultCards = new ArrayList();
     foreach (Mark mark in new Mark[] { Mark.S, Mark.H, Mark.D, Mark.C, Mark.JK })
     {
         if (mark != Mark.JK)
         {
             for (int num = 1; num <= 13; num++)
             {
                 Sprite sprite = CardSprites.getInstance().getSprite(mark, num);
                 createCardObjectWithSprite(mark, num, sprite);
             }
         }
         else
         {
             Sprite sprite = CardSprites.getInstance().getSprite(mark, 0);
             createCardObjectWithSprite(mark, 0, sprite);
         }
     }
 }