示例#1
0
    IEnumerator DrawCard(int amount)
    {
        for (int i = 0; i < amount; ++i)
        {
            GameObject go = deck.DrawCard();
            if (!go)
            {
                deck.ResetDeck();
                go = deck.DrawCard();
            }
            yield return(new WaitForSeconds(0.5f));

            if (handCards.Count < handSizeMax)
            {
                handSize++;
                handCards.Add(go);
                go.transform.position = handCardPos[handCards.Count - 1];
                go.SetActive(true);
                CombatCard cc = go.GetComponent <CombatCard>();
                cc.hand      = this;
                cc.handIndex = handCards.Count - 1;
            }
            else
            {
                grave.AddtoGrave(go);
            }
            yield return(new WaitForSeconds(0.1f));
        }
        yield break;
    }
示例#2
0
 public void PregameSetup()
 {
     Debug.Log("Pregame Setup for " + this.name);
     for (int i = 0; i < 5; i++)
     {
         TheDeck.DrawCard(TheHand);
     }
 }
示例#3
0
    void DeckDraw()
    {
        RaycastHit hitOut;

        if (Utility.ScreenRaycast(out hitOut, DeckMask) && PlayersHand)
        {
            PlayerDeck dc = hitOut.collider.gameObject.GetComponent <PlayerDeck>();
            if (dc)
            {
                dc.DrawCard(PlayersHand);
            }
        }
    }
示例#4
0
    void Update()
    {
        switch (state)
        {
        case State.GameStart:
            if (GameHandler.playerHandSize < GameHandler.playerStartHandSize)
            {
                Debug.Log("Game Start - Drawing Cards");
                playerDeck.DrawCard();
            }
            else
            {
                turnCounter += 1;
                if (OnTurnChanged != null)
                {
                    OnTurnChanged(null, EventArgs.Empty);
                }

                state = State.FirstPlayerTurn;
            }
            break;

        case State.FirstPlayerTurn:

            break;

        case State.FirstEnemyTurn:

            break;

        case State.PlayerTurn:

            break;

        case State.EnemyTurn:
            break;
        }
    }