Updated UniJSON

This commit is contained in:
ousttrue 2018-11-28 15:45:13 +09:00
parent 0455102c74
commit ac66daab25
3 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ namespace VRM
var subFormatter = new JsonFormatter(4);
subFormatter.BeginMap();
foreach (var _kv in node.ObjectItems)
foreach (var _kv in node.ObjectItemsRaw)
{
subFormatter.Key(_kv.Key);
Traverse(_kv.Value, subFormatter, dir);
@ -102,7 +102,7 @@ namespace VRM
{
case JsonValueType.Array:
f.BeginList();
foreach(var x in node.ArrayItems)
foreach(var x in node.ArrayItemsRaw)
{
TraverseItem(x, f, dir);
}
@ -113,7 +113,7 @@ namespace VRM
//Debug.LogFormat("title: {0}", title);
{
f.BeginMap();
foreach (var kv in node.ObjectItems)
foreach (var kv in node.ObjectItemsRaw)
{
f.Key(kv.Key);
TraverseItem(kv.Value, f, dir);

View File

@ -91,15 +91,15 @@ namespace VRM
public static List<glTF_VRM_Material> Parse(JsonNode json)
{
var materials = json.DeserializeList<glTF_VRM_Material>();
var jsonItems = json.ArrayItems.ToArray();
var jsonItems = json.ArrayItemsRaw.ToArray();
for (int i = 0; i < materials.Count; ++i)
{
materials[i].floatProperties =
jsonItems[i]["floatProperties"].ObjectItems.ToDictionary(x => x.Key, x => x.Value.Value.GetSingle());
jsonItems[i]["floatProperties"].ObjectItems.ToDictionary(x => x.Key, x => x.Value.GetSingle());
materials[i].vectorProperties =
jsonItems[i]["vectorProperties"].ObjectItems.ToDictionary(x => x.Key, x =>
{
return x.Value.ArrayItems.Select(y => y.Value.GetSingle()).ToArray();
return x.Value.ArrayItems.Select(y => y.GetSingle()).ToArray();
});
materials[i].keywordMap =
jsonItems[i]["keywordMap"].ObjectItems.ToDictionary(x => x.Key, x => x.Value.GetBoolean());

@ -1 +1 @@
Subproject commit c49fb752bf146fdaed56cfe2655cd45bbefdf83b
Subproject commit 0bc6a981d23bdb6b67f49ded05102f52377943d7