Skip to content

Commit

Permalink
Protect GltfSchemaCommon classes from obfusctaion
Browse files Browse the repository at this point in the history
Manually cherry-picked from go/tbcl/118984

Change-Id: Id000b0157da65c4747f6bff59209ed2bbbf61610
  • Loading branch information
dubois committed Feb 13, 2020
1 parent 9d7f8bc commit d15c982
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -193,6 +196,7 @@ [Serializable] public enum ComponentType {
public abstract GltfBufferViewBase BufferViewPtr { get; }
}

[Serializable]
public abstract class GltfBufferViewBase {
public int byteLength;
public int byteOffset;
Expand All @@ -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;
Expand All @@ -220,25 +225,29 @@ public abstract class GltfPrimitiveBase {
public abstract HashSet<string> GetAttributeNames();
}

[Serializable]
public abstract class GltfImageBase {
public string uri;
[JsonIgnore] public RawImage data;
}

[Serializable]
public abstract class GltfTextureBase {
[JsonIgnore] public Texture2D unityTexture;

public abstract object GltfId { get; }
public abstract GltfImageBase SourcePtr { get; }
}

[Serializable]
public abstract class GltfMaterialBase {
public string name;

public abstract Dictionary<string,string> TechniqueExtras { get; }
public abstract IEnumerable<GltfTextureBase> ReferencedTextures { get; }
}

[Serializable]
public abstract class GltfMeshBase {
public string name;

Expand All @@ -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;
Expand All @@ -256,6 +266,7 @@ public abstract class GltfNodeBase {
public abstract IEnumerable<GltfNodeBase> Children { get; }
}

[Serializable]
public abstract class GltfSceneBase {
public Dictionary<string, string> extras;

Expand Down

0 comments on commit d15c982

Please sign in to comment.