![]() |
Entitas
0.35.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
|
Public Member Functions | |
delegate void | PoolChanged (Pool pool, Entity entity) |
delegate void | GroupChanged (Pool pool, Group group) |
Pool (int totalComponents) | |
Pool (int totalComponents, int startCreationIndex, PoolMetaData metaData) | |
virtual Entity | CreateEntity () |
virtual void | DestroyEntity (Entity entity) |
virtual void | DestroyAllEntities () |
virtual bool | HasEntity (Entity entity) |
Determines whether the pool has the specified entity. | |
virtual Entity [] | GetEntities () |
Returns all entities which are currently in the pool. | |
virtual Group | GetGroup (IMatcher matcher) |
void | ClearGroups () |
void | AddEntityIndex (string name, IEntityIndex entityIndex) |
IEntityIndex | GetEntityIndex (string name) |
Gets the IEntityIndex for the specified name. | |
void | DeactivateAndRemoveEntityIndices () |
Deactivates and removes all entity indices. | |
void | ResetCreationIndex () |
Resets the creationIndex back to 0. | |
void | ClearComponentPool (int index) |
Clears the componentPool at the specified index. | |
void | ClearComponentPools () |
Clears all componentPools. | |
void | Reset () |
override string | ToString () |
Properties | |
int | totalComponents [get] |
Stack< IComponent > [] | componentPools [get] |
PoolMetaData | metaData [get] |
int | count [get] |
Returns the number of entities in the pool. | |
int | reusableEntitiesCount [get] |
int | retainedEntitiesCount [get] |
Events | |
PoolChanged | OnEntityCreated |
Occurs when an entity gets created. | |
PoolChanged | OnEntityWillBeDestroyed |
Occurs when an entity will be destroyed. | |
PoolChanged | OnEntityDestroyed |
Occurs when an entity got destroyed. | |
GroupChanged | OnGroupCreated |
Occurs when a group gets created for the first time. | |
GroupChanged | OnGroupCleared |
Occurs when a group gets cleared. | |
A pool manages the lifecycle of entities and groups. You can create and destroy entities and get groups of entities. The prefered way is to use the generated methods from the code generator to create a Pool, e.g. Pools.sharedInstance.pool = Pools.CreatePool();
|
inline |
|
inline |
|
inline |
Adds the IEntityIndex for the specified name. There can only be one IEntityIndex per name.
|
inline |
|
inlinevirtual |
Creates a new entity or gets a reusable entity from the internal ObjectPool for entities.
|
inlinevirtual |
|
inlinevirtual |
Destroys the entity, removes all its components and pushs it back to the internal ObjectPool for entities.
|
inline |
|
get |
|
get |
|
get |
Returns the number of entities that are currently retained by other objects (e.g. Group, GroupObserver, ReactiveSystem).
|
get |
Returns the number of entities in the internal ObjectPool for entities which can be reused.
|
get |