Exemple #1
0
    public CardSlot GetSlotCard(Assets.Scripts.Data.CreatureCardData data, bool opponentSide = false)
    {
        var slot = Instantiate(_cardSlotPrefab);
        var card = GetCard(data);

        slot.AddCard(card, data.Taunt, opponentSide);
        foreach (var upg in data.Upgrades)
        {
            slot.AddUpgrade(GetCard(upg));
        }
        if (data.CardUnder)
        {
            var archonCard = Instantiate(_archonCardPrefab);
            archonCard.transform.SetParent(slot.transform);
            archonCard.transform.SetAsFirstSibling();
            archonCard.transform.position = new Vector3(0, -40, 0);
        }
        return(slot);
    }
Exemple #2
0
    public Card GetCard(Assets.Scripts.Data.CreatureCardData data)
    {
        var card  = Instantiate(_cardPrefab);
        var front = _cardLoader.GetCard(data.Id);

        card.SetFront(front);

        if (data.Amber > 0)
        {
            card.AddMarker(CreateMarker(_amberMarker, data.Amber));
        }

        if (data.Damage > 0)
        {
            card.AddMarker(CreateMarker(_damageMarker, data.Damage));
        }

        if (data.Stun)
        {
            card.AddMarker(CreateMarker(_stunMarker));
        }

        if (data.Ward)
        {
            card.AddMarker(CreateMarker(_wardMarker));
        }

        if (data.Enrage)
        {
            card.AddMarker(CreateMarker(_enrageMarker));
        }

        if (data.Power > 0)
        {
            card.AddMarker(CreateMarker(_powerMarker, data.Power));
        }

        return(card);
    }