public void LoadCard(Card c) { if (c == null) { return; } card = c; c.cardType.OnSetType(this); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementInt) { 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.GetProperties(t); type.text.text = typename; }
public void Load(Card c) { if (c == null) { return; } card = c; c.cardType.OnSetType(this); CloseAll(); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.e); if (p == null) { continue; } if (cp.e is IntElement) { p.text.text = cp.intValue.ToString(); p.text.gameObject.SetActive(true); } else if (cp.e is StringElement) { p.text.text = cp.stringValue; p.text.gameObject.SetActive(true); } else if (cp.e is ImageElement) { p.img.sprite = cp.spriteValue; p.img.gameObject.SetActive(true); } } }
public CardVizProperties GetProperties(Element e) { CardVizProperties result = null; for (int i = 0; i < properties.Length; i++) { if (properties[i].element == e) { result = properties[i]; break; } } return(result); }
public void LoadCard(Card c) { if (c == null) { return; } card = c; //c.cardtype.OnSetType(this); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperties(cp.element); if (p == null) { continue; } if (cp.element is ElementText) { p.text.text = cp.stringValue; } else if (cp.element is ElementImage) { p.img.sprite = cp.sprite; } else if (cp.element is ElementInt) { p.text.text = cp.intValue.ToString(); } } /* * title.text = c.cardName; * detail.text = c.cardDetail; * if(string.IsNullOrEmpty(c.cardFlavor)) * { * flavor.gameObject.SetActive(false); * } * else * { * flavor.gameObject.SetActive(true); * flavor.text = c.cardFlavor; * } * * artist.text = c.artist; * art.sprite = c.art; */ }
public virtual void OnSetType(CardViz viz) { Element t = GameManager.GetResourceManager().typeElement; CardVizProperties type = viz.GetProperty(t); //type.text.text = typeName; }