public static GLTFAccessorSparseIndices Deserialize(GLTFRoot root, JsonReader reader)
        {
            var indices = new GLTFAccessorSparseIndices();

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

                switch (curProp)
                {
                case "bufferView":
                    indices.BufferView = GLTFBufferViewId.Deserialize(root, reader);
                    break;

                case "byteOffset":
                    indices.ByteOffset = reader.ReadAsInt32().Value;
                    break;

                case "componentType":
                    indices.ComponentType = (GLTFComponentType)reader.ReadAsInt32().Value;
                    break;

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

            return(indices);
        }
Exemple #2
0
        public static GLTFAccessorSparse Deserialize(GLTFRoot root, JsonReader reader)
        {
            var accessorSparse = new GLTFAccessorSparse();

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

                switch (curProp)
                {
                case "count":
                    accessorSparse.Count = reader.ReadAsInt32().Value;
                    break;

                case "indices":
                    accessorSparse.Indices = GLTFAccessorSparseIndices.Deserialize(root, reader);
                    break;

                case "values":
                    accessorSparse.Values = GLTFAccessorSparseValues.Deserialize(root, reader);
                    break;

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

            return(accessorSparse);
        }