Skip to content

Entity API

Alex Silaev edited this page Jun 2, 2023 · 2 revisions
// Create new entity with current world context
var ent = Ent.New();
// Create new entity in the world
var ent = Ent.New(in world);
// Create new entity in the system
var ent = Ent.New(in systemContext);
// Create new entity by world id
var ent = Ent.New(worldId);
// Destroy entity
ent.Destroy();
// Get entity's version
// Returns number of API calls with may change entity's state (Get/Remove/Set) 
ent.Version;
// Get entity's version group (use with ComponentGroup attribute)
// Returns number of API calls which may change entity's state (Get/Remove/Set) for components having this groupId
ent.GetVersion(groupId);
// Clone entity
var clone = ent.Clone();
// Clone entity with hierarchy
var clone = ent.Clone(true);
// Copy entity
ent.CopyFrom(sourceEntity);
// Get entity representation as ulong
ent.ToULong();
// Find entity by ulong
new Ent(ulong);
Clone this wiki locally