Exemple #1
0
    public void CreateCard(int index, Sprite sprite, ULess.Card card, SpellPartType type = SpellPartType.first)
    {
        CardItems[index] = new SpellPart(sprite, card, type: type);
        var cardObj = new GameObject();

        cardObj.transform.parent = GameFolders.Cards.transform;
        cardObj.name             = $"Card{index}";
        var tempPosition = transform.position;

        tempPosition.x            += (index * 1.5f);
        cardObj.transform.position = tempPosition;
        var cardObjCardComponent = cardObj.AddComponent <Card>();

        cardObjCardComponent.SetIndex(index);
        cardObjCardComponent.sprite = sprite;
        _lastIndex = index;
    }
Exemple #2
0
 public SpellPart(Sprite sprite, ULess.Card card, SpellPartType type) : this(sprite, type)
 {
     Card = card;
 }