void Awake() { LevelGroup[] childGroups = GetComponentsInChildren <LevelGroup>(); thisGroup.allLevels = new List <GameObject>(); for (int i = 0; i < childGroups.Length; i++) { for (int o = 0; o < childGroups[i].levels.Count; o++) { // Debug.Log(i + " " + o); thisGroup.allLevels.Add(childGroups[i].levels[o]); } } statsManager = GameObject.Find("StatsManager").GetComponent <StatsManager>(); statsManager.AddLevelsByMode(thisGroup.allLevels, mode); }