Esempio n. 1
0
        public static AccessorSparse Deserialize(GLTFRoot root, JsonReader reader)
        {
            var accessorSparse = new AccessorSparse();

            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 = AccessorSparseIndices.Deserialize(root, reader);
                    break;

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

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

            return(accessorSparse);
        }
Esempio n. 2
0
        public static AccessorSparseValues Deserialize(GLTFRoot root, JsonReader reader)
        {
            var values = new AccessorSparseValues();

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

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

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

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

            return(values);
        }