public void SetPart(SpellPartType type, SpellPart spell) { //Check if spell able to be set // setPart(type, spell); }
private void setPart(SpellPartType type, SpellPart spell) { if (!Parts.ContainsKey(type)) { Parts.Add(type, spell); } else { Parts[type] = spell; } //displ spell icon transform.GetChild((int)type).GetComponent <SpriteRenderer>().sprite = Parts[type].Sprite; }
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; }
public SpellPart(Sprite sprite, SpellPartType type = SpellPartType.first) { Sprite = sprite; Type = type; }