// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 namespace GLTFast.Schema { /// /// Sparse indices property of a glTF /// /// [System.Serializable] public class AccessorSparseIndices { /// /// The index of the bufferView with sparse indices. /// Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target. /// public uint bufferView; /// /// The offset relative to the start of the bufferView in bytes. Must be aligned. /// public int byteOffset; /// /// The indices data type. Valid values correspond to WebGL enums: /// `5121` (UNSIGNED_BYTE) /// `5123` (UNSIGNED_SHORT) /// `5125` (UNSIGNED_INT) /// public GltfComponentType componentType; internal void GltfSerialize(JsonWriter writer) { writer.AddObject(); writer.AddProperty("bufferView", bufferView); writer.AddProperty("componentType", componentType); if (byteOffset >= 0) { writer.AddProperty("byteOffset", byteOffset); } writer.Close(); } } }