Esempio n. 1
0
    protected virtual void SetupHand()
    {
        deck = GameObject.Find("Deck").GetComponent <DeckOfCards>();
        hand = new List <DeckOfCards.Card>();
        HitMe();
        HitMe();

        if (handVals == 21)
        {
            BlackJackManager manager = GameObject.Find("BlackJackManager").GetComponent <BlackJackManager>();
            manager.BlackJack();
            //manager.HidePlayerButtons();
        }
    }
Esempio n. 2
0
    protected virtual void ShowValue()
    {
        handVals = GetHandValue();

        total.text = "Player: " + handVals;

        BlackJackManager manager = GameObject.Find("BlackJackManager").GetComponent <BlackJackManager>();

        if (handVals > 21)
        {
            manager.PlayerBusted();
        }
        if (handVals == 21 && isSetup) // if player has 21 during setup, show BlackJack! prompt
        {
            manager.BlackJack();
        }
        if (handVals == 21 && !isSetup) // if player has 21 after setup, automatically declare win
        {
            manager.HideShowPlayerButtons(false);
            manager.PlayerWin();
        }
    }