示例#1
0
    void IDropHandler.OnDrop(PointerEventData eventData)
    {
        Player            player            = playerPanel.GetComponent <Player>();
        CardObjectSpawner cardObjectSpawner = objectSpawner.GetComponent <CardObjectSpawner>();
        CardController    cardController    = eventData.pointerDrag.GetComponent <CardController>();
        CardData          cardData          = eventData.pointerDrag.GetComponent <CardData>();

        if (cardController != null && cardData != null)
        {
            if (player.CanDrawCard(cardData.manaCost))
            {
                cardObjectSpawner.SpawnMinion(cardData);
                player.ReduceMana(cardData.manaCost);
                cardController.DestroyCard();
            }
        }
    }
示例#2
0
 void _OnCardDestroyed(CardDestroyed e)
 {
     CardController.DestroyCard(e.player, e.card);
 }