private void RefreshList() { if (Container.transform.childCount > 0) { ClearList(); } var allList = allListRepo.GetAll().ToList(); foreach (var elemlist in allList) { var ele = Instantiate(templetaElementList); ele.transform.SetParent(Container.transform); ele.NameList = elemlist.NameListOfWords; ele.ID = elemlist.ID; ele.onDelete = (e) => { FindObjectOfType <MessageBox>().ShowYesNoWindow($"Czy napewno usunÄ… liste o nazwie: {e.NameList}?", () => RemoveItemFromList(e)); }; ele.onEdit = (e) => GoToListView(e.NameList); } Vector2 vec = Container.GetComponent <RectTransform>().sizeDelta; vec.y = templetaElementList.GetComponent <RectTransform>().rect.height *allList.Count; Container.GetComponent <RectTransform>().sizeDelta = vec; }