public static GLTFAnimationChannelTarget Deserialize(GLTFRoot root, JsonReader reader) { var animationChannelTarget = new GLTFAnimationChannelTarget(); if (reader.Read() && reader.TokenType != JsonToken.StartObject) { throw new Exception("Animation channel target must be an object."); } while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "node": animationChannelTarget.Node = GLTFNodeId.Deserialize(root, reader); break; case "path": animationChannelTarget.Path = reader.ReadStringEnum <GLTFAnimationChannelPath>(); break; default: animationChannelTarget.DefaultPropertyDeserializer(root, reader); break; } } return(animationChannelTarget); }
public static GLTFAnimationChannel Deserialize(GLTFRoot root, JsonReader reader) { var animationChannel = new GLTFAnimationChannel(); while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "sampler": animationChannel.Sampler = GLTFSamplerId.Deserialize(root, reader); break; case "target": animationChannel.Target = GLTFAnimationChannelTarget.Deserialize(root, reader); break; default: animationChannel.DefaultPropertyDeserializer(root, reader); break; } } return(animationChannel); }