Builtin Library
README.md
scene_saver.recordDiff
The comparisons the saver's record diffs (transformDiffLines, recordDiffLines, the pending scene edits) are built from.
diffEqual(a, b)andvaluesEqual(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)andcomponentData(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)handspushone 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