public void OnStartLevel() { if (m_rootNodeGroup != null) { int childCount = m_rootNodeGroup.GetNumChildren(); for (int i = 0; i < childCount; ++i) { LevelBase level = m_rootNodeGroup.GetChild(i) as LevelBase; if (level != null) { level.OnStartLevel(); } } } }
public void TransitionToLevel(int id) { if (levelDictionary.ContainsKey(id)) { if (currentLevel != null) { currentLevel.OnEndLevel(); } currentLevel = levelDictionary[id]; currentLevel.OnStartLevel(); eventManager.FireEvent(NewTargetWeightEvent, new NewTargetWeightEventArgs(currentLevel.WeightGoal, currentLevel.WeightMax)); } else { Debug.LogError("Unable to find level with Id: " + id.ToString()); } }