public void UpdateStarsCount() { if (objectives == null) { return; } int starsCount = LevelSettings.GetStarsCount(); int initialChildCount = objectives.childCount; for (int i = 0; i < initialChildCount; i++) { objectives.GetChild(i).GetChild(1).gameObject.SetActive(i < starsCount); } }