public void LoadCard(Card c) { if (c != null) { card = c; card.cardType.OnSetType(this); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (cp.element is ElementInt) { if (cp != null) { } //p.text.text = cp.intValue.ToString(); } else if (cp.element is ElementText) { p.text.text = cp.stringValue; } else if (cp.element is ElementImage) { p.img.sprite = cp.sprite; } } } }
public virtual void OnSetType(CardViz viz) { Element t = Settings.GetResourcesManager().typeElement; CardVizProperties type = viz.GetProperty(t); type.text.text = typeName; }
public CardVizProperties GetProperty(Element e) { CardVizProperties cardVizProperties = null; for (int i = 0; i < properties.Length; i++) { if (properties[i].element == e) { cardVizProperties = properties[i]; break; } } return(cardVizProperties); }