Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit8d45df8664

README.md

scene_saver.recordDiff

The comparisons the saver's record diffs (transformDiffLines, recordDiffLines, the pending scene edits) are built from.

  • diffEqual(a, b) and valuesEqual(a, b) compare two record values, numbers within a tolerance that absorbs the f32 round trip of a live read.
  • componentMatchName(t) answers the name a component type matches by, whichever spelling the record used; componentList(rec), componentMatchNameOf(c), componentInstanceLabel(c, typeName) and componentData(c) read a record's components the way the comparison needs them, answering empty for a malformed record.
  • selfWrittenFieldSet(entityId, componentType, instanceName) answers the fields a component instance wrote about its own runtime.
  • pushAttributeDiffLines(oldRec, newRec, push) hands push one line per attribute added, changed or removed.
local RecordDiff = require("@builtin::assetTypes.scene.shared.saver.recordDiff")
assert(RecordDiff.diffEqual({ 1, 2 }, { 1.00001, 2 }))
RecordDiff.pushAttributeDiffLines({ attributes = { hp = 1 } }, { attributes = {} }, print) -- - attribute.hp