Exemplo n.º 1
0
 /// <summary>
 /// update the stored count of cards in the deck by a specified amount
 /// </summary>
 /// <param name="cardChangeAmount"></param>
 private void updateCardsInDeck(int cardChangeAmount)
 {
     cardsInTheDeck += cardChangeAmount;
     //try to update the gui
     if (updateGUI)
     {
         if (deckGUI == null)
         {
             deckGUI = GetComponentInChildren <DeckGUI>();
             if (deckGUI == null)
             {
                 GameObject guiObject = GameObject.Find("Deck GUI");
                 if (guiObject != null)
                 {
                     deckGUI = GameObject.Find("Deck GUI").GetComponent <DeckGUI>();
                 }
                 if (deckGUI == null)
                 {
                     Debug.LogError("No deck UI found for deck on " + name + ":" + transform.GetInstanceID());
                 }
             }
         }
         else
         {
             deckGUI.updateDisplayInformation();
         }
     }
 }
Exemplo n.º 2
0
 private void ChangeCardUI(int index, Card card)
 {
     handUI[index].card          = card;
     handUI[index].cardUI.sprite = DeckGUI.GetCardUI((int)card.Suit, card.Rank);
 }
Exemplo n.º 3
0
 /// <summary>
 /// to be used by deckGui if it finds a deck
 /// </summary>
 /// <param name="gui"></param>
 public void setDeckGUI(DeckGUI gui)
 {
     deckGUI   = gui;
     updateGUI = true;
 }
Exemplo n.º 4
0
 private void Start()
 {
     Bets.InitializeCredits();
     DeckGUI.GenerateDeckUI();
 }