I have an external tool that saves date in JSON format. Basically the data is a table (list) of instances of a class similar to the one below:
private class StoryEventsRow
{
public string ID { get; set; }
public string TYPE { get; set; }
public int DAY { get; set; }
public int TIME { get; set; }
public List< string > CONDITIONS_START { get; set; }
public List< string > CONDITIONS_ACTIVATE { get; set; }
public List< string > CONDITIONS_LEAVE { get; set; }
public string NAME { get; set; }
public string ACTOR { get; set; }
public string SPAWN { get; set; }
public string GOAL { get; set; }
public string DESPAWN { get; set; }
public string ACTION { get; set; }
public string CONVERSATION { get; set; }
public int TIMEOUT { get; set; }
public int REPEAT { get; set; }
public List< string > REWARDS { get; set; }
public List< string > PENALTIES { get; set; }
}
I would prefer the JSON library that would deserialize the file directly into:
var events = FantasticJsonLibrary.Deserialize<List<StoryEventsRow>>(inputFile);
Which one form JSON libraries available at Asset Store will be best for this purpose?
Actually not many of them. Only those which support generic deserialization. Many simpler libraries available in the Asset Store only return data as e.g. Hashtable.
Thank you, worked like a charm. Easy to use and free.