Пример #1
0
        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);
        }
Пример #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);
        }