diff --git a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs index e368dafa..0c6099e7 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs @@ -146,6 +146,7 @@ public class MeshPrecursor { // For more info on the spec, see: // https://github.com/KhronosGroup/glTF/ +[Serializable] public abstract class GltfRootBase : IDisposable { public GltfAsset asset; // Tilt Brush/Blocks version that generated the gltf; null if not generated by that program @@ -170,12 +171,14 @@ public void Dispose() { protected virtual void Dispose(bool disposing) {} } +[Serializable] public abstract class GltfBufferBase { public long byteLength; public string uri; [JsonIgnore] public IBufferReader data; } +[Serializable] public abstract class GltfAccessorBase { [Serializable] public enum ComponentType { BYTE = 5120, UNSIGNED_BYTE = 5121, SHORT = 5122, UNSIGNED_SHORT = 5123, @@ -193,6 +196,7 @@ [Serializable] public enum ComponentType { public abstract GltfBufferViewBase BufferViewPtr { get; } } +[Serializable] public abstract class GltfBufferViewBase { public int byteLength; public int byteOffset; @@ -201,6 +205,7 @@ public abstract class GltfBufferViewBase { public abstract GltfBufferBase BufferPtr { get; } } +[Serializable] public abstract class GltfPrimitiveBase { [Serializable] public enum Mode { TRIANGLES = 4 } public Mode mode = Mode.TRIANGLES; @@ -220,11 +225,13 @@ public abstract class GltfPrimitiveBase { public abstract HashSet GetAttributeNames(); } +[Serializable] public abstract class GltfImageBase { public string uri; [JsonIgnore] public RawImage data; } +[Serializable] public abstract class GltfTextureBase { [JsonIgnore] public Texture2D unityTexture; @@ -232,6 +239,7 @@ public abstract class GltfTextureBase { public abstract GltfImageBase SourcePtr { get; } } +[Serializable] public abstract class GltfMaterialBase { public string name; @@ -239,6 +247,7 @@ public abstract class GltfMaterialBase { public abstract IEnumerable ReferencedTextures { get; } } +[Serializable] public abstract class GltfMeshBase { public string name; @@ -247,6 +256,7 @@ public abstract class GltfMeshBase { public abstract GltfPrimitiveBase GetPrimitiveAt(int i); } +[Serializable] public abstract class GltfNodeBase { public string name; public Matrix4x4? matrix; @@ -256,6 +266,7 @@ public abstract class GltfNodeBase { public abstract IEnumerable Children { get; } } +[Serializable] public abstract class GltfSceneBase { public Dictionary extras;