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; }
public SpellPart(Sprite sprite, ULess.Card card, SpellPartType type) : this(sprite, type) { Card = card; }