Exemplo n.º 1
0
    IEnumerator ThrowToDiscard(CardInHand card)
    {
        card.transform.SetParent(transform.parent);
        card.StartChanging(selectPosition.localPosition, 0, 1.5f);
        GameObject cardGO = card.gameObject;

        yield return(new WaitForSeconds(1f));

        card.StartChanging(discardPilePosition.localPosition, 0, 0);
        StartCoroutine(DestroyCard(cardGO));
    }
Exemplo n.º 2
0
    IEnumerator ThrowToDiscard(CardInHand card)
    {
        GameObject cardGO = card.gameObject;

        yield return(new WaitForSeconds(1f));

        card.StartChanging(discardPile.localPosition, 0, 0);
        card.transform.SetParent(FindObjectOfType <Canvas>().transform);
        StartCoroutine(DestroyCard(cardGO));
    }
Exemplo n.º 3
0
    public void DiscardCard(CardInHand card, bool animate)
    {
        UnselectCard();
        card.active = false;
        card.GetComponentInChildren <Button>().interactable = false;
        cardsInHand.Remove(card);

        if (animate)
        {
            StartCoroutine(ThrowToDiscard(card));
        }
        else
        {
            card.StartChanging(discardPile.localPosition, 0, 0);
            card.transform.SetParent(FindObjectOfType <Canvas>().transform);
            StartCoroutine(DestroyCard(card.gameObject));
        }

        RecalculateCardPositions();
    }