public static AnimationChannel Deserialize(GLTFRoot root, JsonReader reader) { var animationChannel = new AnimationChannel(); while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "sampler": animationChannel.Sampler = SamplerId.Deserialize(root, reader); break; case "target": animationChannel.Target = AnimationChannelTarget.Deserialize(root, reader); break; default: animationChannel.DefaultPropertyDeserializer(root, reader); break; } } return(animationChannel); }
public static AnimationChannelTarget Deserialize(GLTFRoot root, JsonReader reader) { var animationChannelTarget = new AnimationChannelTarget(); 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 = NodeId.Deserialize(root, reader); break; case "path": animationChannelTarget.Path = reader.ReadStringEnum <GLTFAnimationChannelPath>(); break; default: animationChannelTarget.DefaultPropertyDeserializer(root, reader); break; } } return(animationChannelTarget); }
public AnimationChannelTarget(AnimationChannelTarget channelTarget, GLTFRoot gltfRoot) : base(channelTarget) { if (channelTarget == null) { return; } Node = new NodeId(channelTarget.Node, gltfRoot); Path = channelTarget.Path; }
public AnimationChannel(AnimationChannel animationChannel, GLTFRoot root) : base(animationChannel) { if (animationChannel == null) { return; } Sampler = new SamplerId(animationChannel.Sampler, root); Target = new AnimationChannelTarget(animationChannel.Target, root); }