public void ResetArena() { foreach (GameObject holder in transform.FindChildrenWithTag("spawnedObjects")) { holder.SetActive(false); Destroy(holder); } ArenaConfiguration newConfiguration; if (!_environmentManager.GetConfiguration(arenaID, out newConfiguration)) { newConfiguration = new ArenaConfiguration(prefabs); _environmentManager.AddConfiguration(arenaID, newConfiguration); } _arenaConfiguration = newConfiguration; if (_arenaConfiguration.toUpdate) { _arenaConfiguration.SetGameObject(prefabs.GetList()); _builder.Spawnables = _arenaConfiguration.spawnables; _arenaConfiguration.toUpdate = false; agent.maxStep = _arenaConfiguration.T * _agentDecisionInterval; } _builder.Build(); _arenaConfiguration.lightsSwitch.Reset(); }