Example #1
0
    public bool JsonImport(string path, string name)
    {
        string FilePath = path + "/" + name + ".json";

        if (!File.Exists(FilePath))
        {
            return(false);
        }
        MapControllScriptForSerialization mcss = JsonIO.JsonImport <MapControllScriptForSerialization>(path, name);

        MapName      = mcss.MapName;
        BuildingName = mcss.BuildingName;

        return(true);
    }
Example #2
0
    public Dictionary <string, MapBuildingScript> Buildings; //キー: 建物名, 値: 対応するMapBuildingScriptとする.

    //IJsonSaveLoadable
    public bool JsonExport(string path, string name, bool overwrite)
    {
        string filePath = path + "/" + name + ".json";

        if (File.Exists(filePath) && !overwrite)
        {
            return(false);
        }
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }

        MapControllScriptForSerialization mcss = new MapControllScriptForSerialization();

        mcss.MapName      = MapName;
        mcss.BuildingName = BuildingName;

        return(JsonIO.JsonExport(mcss, path, name));
    }