private void Start() { _playerInventory = PlayerManager.GetInstance().inventory; _button = GetComponent <Button>(); _neededInfos = new List <PlayerInventory.Item>(); _infos = DataItems.GetInstance().GatherInfos(iDToGather); for (int i = 0; i < needed.Count; i++) { PlayerInventory.Item item = DataItems.GetInstance().GatherInfos(needed[i].ID); item.Quantity = needed[i].Quantity; _neededInfos.Add(item); GameObject go = Instantiate(ObjectImagePrefab); go.transform.parent = transform; go.GetComponent <Image>().sprite = item.Texture; go.GetComponentInChildren <Text>().text = item.Quantity.ToString(); go.GetComponent <RectTransform>().localPosition = new Vector3(70 + i * 50, 0, 0); } }
private void Start() { _infos = DataItems.GetInstance().GatherInfos(IDToFind); }