public void SetData(ItemContent content) { Id = content.Id; _icon.color = content.Color; _name.text = content.Name; _count.text = content.Count.ToString(); Type = content.ItemType; }
//here, we fill UI window with items representation private void CreateItem(ItemContent content) { var item = Instantiate(_itemPrefab); item.gameObject.SetActive(true); var holder = _holders.FirstOrDefault(x => x.ItemType == content.ItemType); if (holder == null) { return; } item.transform.SetParent(holder.Container); item.transform.localPosition = Vector3.zero; _itemsList.Add(item); item.SetData(content); }