public void Set(Regulus.Project.ItIsNotAGame1.Data.Item item) { _Item = item; Name.text = item.Count.ToString(); Image.sprite = (Sprite)UnityEngine.Resources.Load("Icon/Item/" + _Item.Name , typeof(Sprite)); }
public void Set(Regulus.Project.ItIsNotAGame1.Data.Item item) { _Item = item; Name.text = item.Count.ToString(); Image.sprite = (Sprite)UnityEngine.Resources.Load("Icon/Item/" + _Item.Name, typeof(Sprite)); }
protected void _CreateItem(Regulus.Project.ItIsNotAGame1.Data.Item item) { var slot = GameObject.Instantiate(ItemSource); var rectTransform = slot.GetComponent <RectTransform>(); rectTransform.SetParent(transform); slot.GetComponent <GameItem>().Set(item); var button = slot.GetComponent <UnityEngine.UI.Button>(); button.onClick.AddListener( () => { Description.Set(item); }); }