Here I store my improvements for SimpleJSON lib. [Original repository]
You can check if key contains in JSONClass
publicoverrideboolContainsKey(stringkey)You can get list of JSONNode children
publicList<JSONNode>GetChildrenList()In file SimpleJSONExtensions.cs
publicstaticobjectGetValueByType(thisJSONNodeparam,TypeNeedType)This method is suitable for reflection routines. It automatically selects suitable property to get the value of JSONNode.
FieldInfo[]fields=thisType.GetFields();objectvalue=myNode.GetValueByType(fields[0].FieldType);fields[0].SetValue(InstanceOfType,value);publicstaticvoidParseData(JSONClassparam,objectinstance)You can deserialize JSONClass instance to object. First of all you need to add ParsableValue attribute to fields you want to deserialize. This fields must be named same as fields in JSON you want to deserialize. If you want to use a different name you can specify it in attributes constructor
publicclassEnergyModel{[ParsableValue]//Searching for MaxEnergy in JSONpublicfloatMaxEnergy;[ParsableValue("RSpeed")]//Searching for RSpeed in JSONpublicfloatEnergyRecreationSpeed;}To deserialize just call the method. ParseData currently not supports arrays and nested object.
EnergyModelmodel=newEnergyModel();SimpleJSONExtensions.ParseData(json,model);