private void ShowWorkers(List <string> list) { //create if not there for (int i = 0; i < list.Count; i++) { var found = _tiles.Find(a => a.WorkType == list[i]); if (found == null) { var tile = WorkerTile.CreateTile(gameObject.transform, list[i], new Vector3(), WorkerTile); _tiles.Add(tile); } } //delete if job doesnt exist anymore for (int i = 0; i < _tiles.Count; i++) { var found = list.Find(a => a == _tiles[i].WorkType); if (found == null) { Destroy(_tiles[i].gameObject); _tiles.RemoveAt(i); i--; } } }
private void ShowWorkers(List <string> list) { Hide(); _bulletinWindow.ShowScrool(); for (int i = 0; i < list.Count; i++) { var iniPosHere = _bulletinWindow.ScrollIniPosGo.transform.localPosition + new Vector3(0, -(ReturnRelativeYSpace(4.75f, ReturnTileYScale())) * i, 0); var a = WorkerTile.CreateTile(_bulletinWindow.Content.gameObject.transform, list[i], iniPosHere); _reports.Add(a); } }
private void ShowWorkers(List <string> list) { var tileHeight = -4.35f; var height = list.Count * tileHeight; Hide(); _bulletinWindow.ShowScrool(); _bulletinWindow.AdjustContentHeight(height); for (int i = 0; i < list.Count; i++) { var a = WorkerTile.CreateTile(_bulletinWindow.Content.gameObject.transform, list[i], new Vector3()); _reports.Add(a); } }