Esempio n. 1
0
    private void OnMouseDown()
    {
        if (cardStateReference != CardState.AICard)
        {
            if (cardStateReference == CardState.CardInHand)
            {
                if (userCardHand.GetHandState() == UserHand.HandState.PlayCard)
                {
                    if (userCardHand.GetDeck().GetComponent <DeckBehaviour>().GetPileOfCards().GetCardRef().GetComponent <CardBehaviour>().GetUniqueCardIDColor() == this.uniqueCardIDColor || userCardHand.GetDeck().GetComponent <DeckBehaviour>().GetPileOfCards().GetCardRef().GetComponent <CardBehaviour>().GetUniqueCardIDNumber() == this.uniqueCardIDNumber)
                    {
                        userCardHand.SetCardSelected(false);
                        if (this.transform.position != originalCardPos)
                        {
                            this.transform.position = originalCardPos;
                        }

                        PlayCard();
                    }
                }
            }
        }
    }