private void Start() { if (boardData == null) { boardData = GetComponent <BoardData>(); } //clear previous holes by destroying it foreach (ParcelHole hole in GetComponentsInChildren <ParcelHole>()) { DestroyImmediate(hole.gameObject); } holes = new List <ParcelHole>(); //create new holes based on staticMap configuration in BoardData foreach (Vector2Int p in boardData.GetParcelHolePositions()) { holes.Add(CreateParcelHole(p)); } }