Skip to content

Commit 4367ae7

Browse files
committed
Merge branch 'master' of github.com:gering/Tiny-JSON
* 'master' of github.com:gering/Tiny-JSON: Update README.md Update README.md
2 parents 7eac4f3 + 715ed57 commit 4367ae7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ string json = Json.Encode(dict);
1616
# decoding
1717

1818
```javascript
19+
// Decoding a dictionary from a json string
1920
var dict = Json.Decode<Dictionary<string, int>>(json);
21+
22+
// Decoding a vector2
23+
var vector = Json.Decode<Vector2>("{\"x\":4, \"y\":2}");
24+
25+
// Decoding a list of vector3
26+
var vectors = Json.Decode<IList<Vector3>>("[{\"x\":4, \"y\":3, \"z\":-1}, {\"x\":1, \"y\":1, \"z\":1}, {}]");
2027
```
2128

0 commit comments

Comments
 (0)