Пример #1
0
    void Generate()
    {
        MapSettings ms = new MapSettings(eDepthDimess, textureSavePathRelativeToProject,
                                         mapDataSavePathRelativeToProject);

        FileHelp.SaveStringFile(JsonConvert.SerializeObject(ms),
                                FileHelp.GetFullPathByDataPathRelativePath(MapSettings.mapSettingsProfilesPath));
        AssetDatabase.Refresh();
    }
Пример #2
0
    bool ValidateSavePath()
    {
        bool result = false;

        if (!FileHelp.FolderExistInDataPathRelativePath(textureSavePathRelativeToProject))
        {
            throw new System.Exception("the save path for map textures does not exists!\n" +
                                       FileHelp.GetFullPathByDataPathRelativePath(textureSavePathRelativeToProject));
        }
        else if (!FileHelp.FolderExistInDataPathRelativePath(mapDataSavePathRelativeToProject))
        {
            throw new System.Exception("the save path for map data does not exists!\n" +
                                       FileHelp.GetFullPathByDataPathRelativePath(mapDataSavePathRelativeToProject));
        }
        else
        {
            result = true;
        }
        return(result);
    }