Beispiel #1
0
    private IEnumerator CastingCard()
    {
        currentPhase = TurnPhase.Casting;
        if (optionsMenu != null)
        {
            optionsMenu.gameObject.SetActive(false);
        }

        if (selectedCard is CreatureCard)
        {
            while (selectedSlot == null)
            {
                if (selectedCard == null)
                {
                    break;
                }

                yield return(null);
            }

            if (selectedCard != null && selectedSlot.currentCard == null)
            {
                selectedCard.Cast(selectedSlot);
                creaturesOnField.Add((CreatureCard)selectedCard);
                if (hand.Contains(selectedCard))
                {
                    hand.Remove(selectedCard);
                }
                DelselectCard();
                selectedSlot = null;
            }

            if (hand.Count <= 6)
            {
                layout.spacing = .7f;
            }
        }
        else if (selectedCard is SpellCard)
        {
            //Do different Things
        }
        yield return(new WaitForSeconds(.1f));

        currentPhase = TurnPhase.Main;
    }