DataEntity.md

March 15, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS.Serialize

DataEntity Class

A DataEntity represents an Entity as a POCO class used for serialization.

public sealed class DataEntity

Inheritance System.Object ๐Ÿก’ DataEntity

Remarks

When reading / writing DataEntity's in the editor a special MemoryDatabase" implementation is required.
This implementation preserves the order of entities stored in a JSON file.
Therefor it stores the order of each entity when loaded and apply this order when writing them back to the JSON file.

Having a stable order is required avoid merge conflicts.
Otherwise the entity order in a JSON file would be arbitrary.
Even small changes will show a massive diff in version control.

Fields
childrenThe list of child entity ids.
componentsEach key in components defines the type of a component or script.
Its value is the component / script value.
modifyModify the referenced entity of apreFab.
with components != null
Remove the referenced entity if components == null
pidPermanent id used to identify entities in a database
prefabReference to the Prefab the entity is based on
sceneNameif != null the entity is the root of a scene using the assigned sceneName
tagsList of tags assigned to an entity
Properties
DebugJSONReturn the JSON representation of a DataEntity.
Methods
ToString()