Ejemplo n.º 1
0
        public static GLTFTexture Deserialize(GLTFRoot root, JsonReader reader)
        {
            var texture = new GLTFTexture();

            while (reader.Read() && reader.TokenType == JsonToken.PropertyName)
            {
                var curProp = reader.Value.ToString();

                switch (curProp)
                {
                case "sampler":
                    texture.Sampler = GLTFSamplerId.Deserialize(root, reader);
                    break;

                case "source":
                    texture.Source = GLTFImageId.Deserialize(root, reader);
                    break;

                default:
                    texture.DefaultPropertyDeserializer(root, reader);
                    break;
                }
            }

            return(texture);
        }
        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);
        }