Ejemplo n.º 1
0
    public void RemoveCard()
    {
        if (card.primaryCardType == Constants.CardType.Player)
        {
            return;
        }

        cardQuantity--;
        deckbuilder.RemoveCardCount();
        deckbuilder.deckInProgress.savedDecklist.Remove((int)card.cardID);

        quantityText.text = "x" + cardQuantity.ToString();

        if (cardQuantity <= 0)
        {
            deckbuilder.currentListings.Remove(this);
            if (visualTooltip != null)
            {
                //Debug.Log("Killing tooltip");
                visualTooltip.UnregisterEverything();
                Destroy(visualTooltip.gameObject);
            }


            Destroy(gameObject);
        }
        else
        {
            if (cardQuantity == 1)
            {
                if (quantityImage.activeInHierarchy)
                {
                    quantityImage.SetActive(false);
                }
            }
        }
    }