Beispiel #1
0
    IEnumerator PlayerCard()
    {
        Debug.Log(value);
        clicked           = true;
        system.playerCard = this;
        playerValue.text  = value.ToString();
        yield return(new WaitForSeconds(2f));

        //playerValue.text = null;
        this.gameObject.SetActive(false);

        if (!system.enemyUnit.hasBet)
        {
            system.state = GameState.ENEMYBET;
            system.EnemeyBetTurn();
        }
        else
        {
            if (system.enemyCard != null)
            {
                if (system.playerCard != null)
                {
                    system.state = GameState.COMPARECARDS;
                    system.CompareCards();
                }
                else
                {
                    system.state = GameState.PLAYERTURN;
                    system.PlayerTurn();
                }
            }
            else
            {
                system.state = GameState.ENEMYTURN;
                system.EnemyTurn();
            }
        }
    }