public static AnimationSampler Deserialize(GLTFRoot root, JsonReader reader)
        {
            var animationSampler = new AnimationSampler();

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

                switch (curProp)
                {
                case "input":
                    animationSampler.Input = AccessorId.Deserialize(root, reader);
                    break;

                case "interpolation":
                    animationSampler.Interpolation = reader.ReadStringEnum <InterpolationType>();
                    break;

                case "output":
                    animationSampler.Output = AccessorId.Deserialize(root, reader);
                    break;

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

            return(animationSampler);
        }
Esempio n. 2
0
        public static GLTFAnimation Deserialize(GLTFRoot root, JsonReader reader)
        {
            var animation = new GLTFAnimation();

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

                switch (curProp)
                {
                case "channels":
                    animation.Channels = reader.ReadList(() => AnimationChannel.Deserialize(root, reader));
                    break;

                case "samplers":
                    animation.Samplers = reader.ReadList(() => AnimationSampler.Deserialize(root, reader));
                    break;

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

            return(animation);
        }
        public AnimationSampler(AnimationSampler animationSampler, GLTFRoot gltfRoot) : base(animationSampler)
        {
            if (animationSampler == null)
            {
                return;
            }

            Input         = new AccessorId(animationSampler.Input, gltfRoot);
            Interpolation = animationSampler.Interpolation;
            Output        = new AccessorId(animationSampler.Output, gltfRoot);
        }