Ejemplo n.º 1
0
    void DeleteLevel()
    {
        if (isOfficial)
        {
            foreach (MapInfo mapInfo in mapInfoJson.officialMaps)
            {
                if (mapInfo.author == author && mapInfo.name == levelName)
                {
                    mapInfoJson.officialMaps.Remove(mapInfo);
                    break;
                }
            }
        }
        else
        {
            foreach (MapInfo mapInfo in mapInfoJson.customMaps)
            {
                if (mapInfo.author == author && mapInfo.name == levelName)
                {
                    mapInfoJson.customMaps.Remove(mapInfo);
                    break;
                }
            }
        }

        MyUtils.DeleteLevelFiles(isOfficial, levelName, author);
        string blank = "--";

        SetLevelInfoPanel(blank, blank, blank);
        SaveMapInfo();
        LoadMapButtons(isOfficial);
    }