Writes given child prefabs to the given BinaryWriter
.
writer
BinaryWriter
TheBinaryWriter
to store the binary data into.children
<Array<PrefabChild>>
The child prefabs to store.componentVersions
<Map<number, number>>
A map of component versions to ensure are encoded in the binary data.- Returns:
<void>
import { BinaryWriter, writeChildren } from 'att-string-transcoder';
const writer = new BinaryWriter();
const children = [
{
parentHash: 0,
prefab: new Prefab('Guard')
}
];
const componentVersions = new Map<number, number>([
[ComponentHash.NetworkRigidbody, 1],
[ComponentHash.PhysicalMaterialPart, 1],
[ComponentHash.Pickup, 2]
// etc...
]);
writeChildren(writer, children, componentVersions);