mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-07 11:28:35 -05:00
Updated UniJSON
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user