public void setData(SelectModel model) { nameText.text = model.name; if (model.entered) { if (model.heroId == -1) { head.sprite = nullSP; } else { head.sprite = ResourceLoad.getHead(model.heroId + ""); } } else { head.sprite = ResourceLoad.getHead("Image 19"); } if (model.ready) { selected(); } else { img.color = Color.white; } }
public void setData(int hero) { id = hero; Image sp = btn.gameObject.GetComponent <Image>(); sp.sprite = ResourceLoad.getHead(hero + ""); }