Пример #1
0
    public void LoadNextLevel()
    {
        EndLevel();

        if (m_currentMapIdx < MapList.Count - 1)
        {
            ++m_currentMapIdx;
        }
        else
        {
            DialogsController.GetInstance().ShowDialog(DialogType.MapSelectorMenu);
            return;
        }

        var mapPahs = MapList.GetMapPaths(m_currentMapIdx);

        if (mapPahs == null)
        {
            return;
        }

        ResetTempMapData();
        MapInfo map_info = (mapPahs.GetMapPrefab()).GetComponent <MapInfo>();

        map_info.m_mapName = mapPahs.Name;
        map_info.m_mapIcon = mapPahs.GetMapIcon();
        GameProgress.SetMap(m_currentMapIdx, false);

        DialogsController.GetInstance().ShowMapDescriptionMenu(m_currentMapIdx);
    }
Пример #2
0
    public void LoadLevel(int levelIdx)
    {
        var mapPaths = MapList.GetMapPaths(levelIdx);

        if (mapPaths == null)
        {
            return;
        }

        if (m_map != null)
        {
            EndLevel();
        }

        m_currentMapIdx = levelIdx;
        ResetTempMapData();
        m_mapPrefab = mapPaths.GetMapPrefab();
        LoadSelectedLevel();
    }