Ejemplo n.º 1
0
        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 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 = SamplerId.Deserialize(root, reader);
                    break;

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

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

            return(texture);
        }
Ejemplo n.º 3
0
        public AnimationChannel(AnimationChannel animationChannel, GLTFRoot root) : base(animationChannel)
        {
            if (animationChannel == null)
            {
                return;
            }

            Sampler = new SamplerId(animationChannel.Sampler, root);
            Target  = new AnimationChannelTarget(animationChannel.Target, root);
        }
        public GLTFTexture(GLTFTexture texture, GLTFRoot gltfRoot) : base(texture, gltfRoot)
        {
            if (texture == null)
            {
                return;
            }

            if (texture.Sampler != null)
            {
                Sampler = new SamplerId(texture.Sampler, gltfRoot);
            }

            if (texture.Source != null)
            {
                Source = new ImageId(texture.Source, gltfRoot);
            }
        }
Ejemplo n.º 5
0
 public SamplerId(SamplerId id, GLTFRoot newRoot) : base(id, newRoot)
 {
 }