public void CallBingo(Card card) { //if bingo has been verified, shout bingo and claim your winnings if (WinningCombos.CheckForBingo(card, numbers)) { bingo.Play(); MoneyHolder.Add(winnings); } //Otherwise you will be penalized 50 cents for a bad call. else { badCall.Play(); //MoneyHolder.Deduct((decimal).50); } //keeps the money floor to 0, even after being penalized. if (MoneyHolder.Amount < 0) { MoneyHolder.Amount = 0; } moneyDisplay.text = "Money: $" + MoneyHolder.Amount; //Removes the card out of play. cardCount--; Destroy(card.gameObject); //Automatically ends the game when there are no cards to play with if (cardCount <= 0) { StopCoroutine(CallNumbers()); StartCoroutine(EndRound()); } }
void Start() { if (toggle) { StartCoroutine(WindowFlipper()); } else { displayedCombo = WinningCombos.getWinningCombo(number); UpdatePanels(); } }
IEnumerator WindowFlipper() { //Infinite Loop while (true) { //Flip between winning combos for (int i = 0; i < 32; i++) { yield return(new WaitForSeconds(1)); displayedCombo = WinningCombos.getWinningCombo(i); UpdatePanels(); } } }
// Use this for initialization void Awake() { WinningCombos.Initialize(); }