Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 903 Bytes

writeEntities.md

File metadata and controls

31 lines (22 loc) · 903 Bytes

Function: writeEntities

Writes given entities to the given BinaryWriter.

Signatures

writeEntities(writer, entities, componentVersions)

  • writer BinaryWriter The BinaryWriter to store the binary data into.
  • entities <PrefabEntities> The entities to store.
  • componentVersions <Map<number, number>> A map of component versions to ensure are encoded in the binary data.
  • Returns: <void>
import { BinaryWriter, Entity, writeEntities } from 'att-string-transcoder';

const writer = new BinaryWriter();

const entities = {
  Fire_30100: new Entity<'Torch'>('Fire_30100')
};

const componentVersions = new Map<number, number>([
  [ComponentHash.NetworkRigidbody, 1],
  [ComponentHash.PhysicalMaterialPart, 1],
  [ComponentHash.Pickup, 2]
  // etc...
]);

writeEntities(writer, entities, componentVersions);