public Dictionary<string, string> ToDictionary()
{
if (type == Type.OBJECT)
{
Dictionary<string, string> result = new Dictionary<string, string>();
for (int i = 0; i < list.Count; i++)
{
JSONObject val = list[i];
switch (val.type)
{
case Type.STRING: result.Add(keys[i], val.str); break;
case Type.NUMBER: result.Add(keys[i], val.n + ""); break;
case Type.BOOL: result.Add(keys[i], val.b + ""); break;
default: Debug.LogWarning("Omitting object: " + keys[i] + " in dictionary conversion"); break;
}
}
return result;
}
Debug.LogWarning("Tried to turn non-Object JSONObject into a dictionary");
return null;
}
public static implicit operator bool (JSONObject o)