pack method
Serialize the object using the given builder, returning the offset.
Implementation
@override
int pack(fb.Builder fbBuilder) {
final int? childrenOffset = children == null ? null
: fbBuilder.writeListInt32(children!);
final int? nodesOffset = nodes == null ? null
: fbBuilder.writeList(nodes!.map((b) => b.pack(fbBuilder)).toList());
final int? texturesOffset = textures == null ? null
: fbBuilder.writeList(textures!.map((b) => b.pack(fbBuilder)).toList());
final int? animationsOffset = animations == null ? null
: fbBuilder.writeList(animations!.map((b) => b.pack(fbBuilder)).toList());
fbBuilder.startTable(5);
fbBuilder.addOffset(0, childrenOffset);
if (transform != null) {
fbBuilder.addStruct(1, transform!.pack(fbBuilder));
}
fbBuilder.addOffset(2, nodesOffset);
fbBuilder.addOffset(3, texturesOffset);
fbBuilder.addOffset(4, animationsOffset);
return fbBuilder.endTable();
}