Exemple #1
0
    private void LoadGeneral(ZipArchive archive)
    {
        int index = GetZipArchiveEntryIndex("general.json", archive);

        if (index == -1)
        {
            return;
        }

        ZipArchiveEntry entry = archive.Entries[index];

        using (StreamReader file = new StreamReader(entry.Open()))
        {
            JsonSerializer serializer = new JsonSerializer
            {
                Converters = { new Vector3Converter() }
            };
            gm.CopyStruct((GeneralManagerStruct)serializer.Deserialize(file, typeof(GeneralManagerStruct)));
        }
    }