Esempio n. 1
0
    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();
                }
            }
        }
    }
Esempio n. 2
0
    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());
        }
    }
Esempio n. 3
0
    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());
        }
    }