/// <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(); } } }
private void ChangeCardUI(int index, Card card) { handUI[index].card = card; handUI[index].cardUI.sprite = DeckGUI.GetCardUI((int)card.Suit, card.Rank); }
/// <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; }
private void Start() { Bets.InitializeCredits(); DeckGUI.GenerateDeckUI(); }