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 | |
|---|---|
| children | The list of child entity ids. |
| components | Each key in components defines the type of a component or script. Its value is the component / script value. |
| modify | Modify the referenced entity of apreFab.with components != null Remove the referenced entity if components == null |
| pid | Permanent id used to identify entities in a database |
| prefab | Reference to the Prefab the entity is based on |
| sceneName | if != null the entity is the root of a scene using the assigned sceneName |
| tags | List of tags assigned to an entity |
| Properties | |
|---|---|
| DebugJSON | Return the JSON representation of a DataEntity. |
| Methods | |
|---|---|
| ToString() |