private void ClearAllEvents() { if (spawnManager) { if (spawnerObjects != null) { for (int i = 0; i < spawnerObjects.Count; i++) { Spawner spawner = spawnManager.spawners[i].Prefab.GetComponent <Spawner>(); SpawnerObject spawnerObject = spawnerObjects[i]; for (int j = 0; j < spawnerObject.waveObjects.Count; j++) { Wave wave = spawner.waves[j]; wave.ClearEvents(); WaveObject waveObject = spawnerObject.waveObjects[j]; for (int k = 0; k < waveObject.levelUnitsList.Count; k++) { WaveObject.LevelObjectData levelUnitStruct = waveObject.levelUnitsList[k]; LevelUnit levelUnit = levelUnitStruct.levelUnit.GetComponent <LevelUnit>(); if (levelUnit) { levelUnit.ClearNamedStateEventsLists(); } } } } } } musicIntensityManager.ClearAll(); }