renumberEntityZero
此内容尚不支持你的语言。
renumberEntityZero(
data):boolean
Defined in: sdk/src/scene/scene.ts:525
Gives an entity numbered 0 the next id past the highest, and its parent and children the new id too, in place. Returns whether it did.
0 is the “no entity” of every reference field (INVALID_ENTITY), so a field naming entity 0 named nothing: the loader leaves 0 as 0, and the inspector writes 0 for both. A field that holds 0 is left as none, which is what it has always loaded as; the entity can be named from now on. Only the hierarchy is renumbered, because nothing else could reach it.
For an authoring tool opening a document, not for a loader: a caller that loads a scene keeps its own copy of the data and looks entities up by the ids in it, so renumbering inside a load would lose entity 0 to every such lookup. The editor renumbers what it opens; what it saves then holds no entity 0.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean