Exemple #1
0
    void Update()
    {
        if (checkForDealerHand)
        {
            if (dh.fin)
            {
                int d = dh.handValue();
                int p = handValue();
                checkForDealerHand = false;

                if (d > p)
                {
                    if (d > 21)
                    {
                        // p win
                        uiPWin.SetActive(true);
                    }
                    else
                    {
                        // d win
                        uiDWin.SetActive(true);
                    }
                }
                else if (d < p)
                {
                    // p win
                    uiPWin.SetActive(true);
                }
                else if (d == p)
                {
                    // draw
                    uiDraw.SetActive(true);
                }
            }
        }
    }