Beispiel #1
0
    public void OnEndDrag(PointerEventData eventData)
    {
        //Debug.Log($"OnEndDrag + {gameObject.name}");
        if (cardLayout)
        {
            Card card = GetComponentInParent <Card>();
            cardLayout.MakeChild(card, false);
        }

        FindObjectOfType <CardFaceMaster>().CardDrop();
        transform.position = transform.parent.position;
    }
Beispiel #2
0
    public void PlayCard()
    {
        if (ListToOrder(fateCards.CardsInHand()).Count < 1)
        {
            return;
        }

        fateAttackCard = ListToOrder(fateCards.CardsInHand()).Last();
        fateAttackCard.GetComponentInChildren <CardUiMover>().isFrozen = true;

        attackArea.MakeChild(fateAttackCard);
    }
Beispiel #3
0
    public void Draw(Card cardToDiscard)
    {
        Card card = ShowCard(deck.cardsInDrawPile, cardToDiscard);

        if (card != null)
        {
            card.cardInfo.handInUse = this;
            card.GetComponentInChildren <CardDisplay>().GetComponent <Image>().color = Color.white;
            deck.cardsInDrawPile.Remove(card);
            allCardsInUse.Add(card);

            card.transform.position = transform.position;

            Sequence mySequence = DOTween.Sequence();
            mySequence
            .AppendInterval(0.5f)
            .AppendCallback(card.ShowFront)
            .Append(card.transform.DOMove(Vector3.zero, 0.5f))
            .Append(card.transform.DOMove(MoveTo(card).transform.position, 0.5f))
            .AppendInterval(0.1f)
            .OnComplete(() => MoveTo(card).MakeChild(card));

            //card.transform.position = transform.position;


            //hand.MakeChild(card);
            return;
        }

        card = ShowCard(deck.cardsInDiscardPile, cardToDiscard);
        if (card != null)
        {
            card.cardInfo.handInUse = this;
            card.GetComponentInChildren <CardDisplay>().GetComponent <Image>().color = Color.white;
            deck.cardsInDiscardPile.Remove(card);
            allCardsInUse.Add(card);
            hand.MakeChild(card);
            return;
        }

        if (card == null)
        {
            Debug.LogWarning("No Card To Discard");
        }
    }