Skip to content

Commit d15c982

Browse files
committed
Protect GltfSchemaCommon classes from obfusctaion
Manually cherry-picked from go/tbcl/118984 Change-Id: Id000b0157da65c4747f6bff59209ed2bbbf61610
1 parent 9d7f8bc commit d15c982

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfSchemaCommon.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public class MeshPrecursor {
146146
// For more info on the spec, see:
147147
// https://github.com/KhronosGroup/glTF/
148148

149+
[Serializable]
149150
public abstract class GltfRootBase : IDisposable {
150151
public GltfAsset asset;
151152
// Tilt Brush/Blocks version that generated the gltf; null if not generated by that program
@@ -170,12 +171,14 @@ public void Dispose() {
170171
protected virtual void Dispose(bool disposing) {}
171172
}
172173

174+
[Serializable]
173175
public abstract class GltfBufferBase {
174176
public long byteLength;
175177
public string uri;
176178
[JsonIgnore] public IBufferReader data;
177179
}
178180

181+
[Serializable]
179182
public abstract class GltfAccessorBase {
180183
[Serializable] public enum ComponentType {
181184
BYTE = 5120, UNSIGNED_BYTE = 5121, SHORT = 5122, UNSIGNED_SHORT = 5123,
@@ -193,6 +196,7 @@ [Serializable] public enum ComponentType {
193196
public abstract GltfBufferViewBase BufferViewPtr { get; }
194197
}
195198

199+
[Serializable]
196200
public abstract class GltfBufferViewBase {
197201
public int byteLength;
198202
public int byteOffset;
@@ -201,6 +205,7 @@ public abstract class GltfBufferViewBase {
201205
public abstract GltfBufferBase BufferPtr { get; }
202206
}
203207

208+
[Serializable]
204209
public abstract class GltfPrimitiveBase {
205210
[Serializable] public enum Mode { TRIANGLES = 4 }
206211
public Mode mode = Mode.TRIANGLES;
@@ -220,25 +225,29 @@ public abstract class GltfPrimitiveBase {
220225
public abstract HashSet<string> GetAttributeNames();
221226
}
222227

228+
[Serializable]
223229
public abstract class GltfImageBase {
224230
public string uri;
225231
[JsonIgnore] public RawImage data;
226232
}
227233

234+
[Serializable]
228235
public abstract class GltfTextureBase {
229236
[JsonIgnore] public Texture2D unityTexture;
230237

231238
public abstract object GltfId { get; }
232239
public abstract GltfImageBase SourcePtr { get; }
233240
}
234241

242+
[Serializable]
235243
public abstract class GltfMaterialBase {
236244
public string name;
237245

238246
public abstract Dictionary<string,string> TechniqueExtras { get; }
239247
public abstract IEnumerable<GltfTextureBase> ReferencedTextures { get; }
240248
}
241249

250+
[Serializable]
242251
public abstract class GltfMeshBase {
243252
public string name;
244253

@@ -247,6 +256,7 @@ public abstract class GltfMeshBase {
247256
public abstract GltfPrimitiveBase GetPrimitiveAt(int i);
248257
}
249258

259+
[Serializable]
250260
public abstract class GltfNodeBase {
251261
public string name;
252262
public Matrix4x4? matrix;
@@ -256,6 +266,7 @@ public abstract class GltfNodeBase {
256266
public abstract IEnumerable<GltfNodeBase> Children { get; }
257267
}
258268

269+
[Serializable]
259270
public abstract class GltfSceneBase {
260271
public Dictionary<string, string> extras;
261272

0 commit comments

Comments
 (0)