Entity Component System API reference
This page contains an overview of some key APIs that make up Unity's Entity Component System (ECS).
| Entity types | Description |
|---|---|
| Entity | The fundamental identifier in ECS. |
| EntityArchetype | A unique combination of component types. For more information, see Archetype concepts. |
| EntityQuery | Select entities with specific characteristics. For more information, see Querying entity data with an entity query. |
| EntityQueryBuilder | Create EntityQuery objects. |
| EntityManager | Manages entities and provides utility methods. |
| World | An isolated collection of entities. For more information see World concepts |
| Component types | Description |
|---|---|
| IComponentData | A marker interface for general purpose components. |
| ISharedComponentData | A marker interface for components that more than one entity shares. For moe information, see Shared components. |
| ICleanupComponentData | A marker interface for specialized system components. For more information, see Cleanup components. |
| IBufferElementData | A marker interface for buffer elements. For more information, see Buffer components. |
| DynamicBuffer | Access buffer elements. |
| BlobAssetReference | A reference to a blob asset in a component. |
| System types | Description |
|---|---|
| ISystem | An interface to create systems from. |
| ComponentSystemBase | Defines a set of basic functionality for systems. For more information, see Creating systems with SystemBase. |
| SystemBase | The base class to extend when writing a system. |
| ComponentSystemGroup | A group of systems that update as a unit. For more information, see System groups. |
| ECS job types | Description |
|---|---|
| IJobEntity | An interface to implicitly create a job that iterates over the entities. For more information, see Iterate over component data with IJobEntity. |
| Entities.ForEach | An implicitly created job that iterates over a set of entities. For more information, see Iterate over data with Entities.ForEach. |
| Job.WithCode | An implicitly created single job. |
| IJobChunk | An interface to explicitly create a job that iterates over the chunks matched by an entity query. For more information, see Iterate over data with IJobChunk. |
| Other important types | Description |
|---|---|
| ArchetypeChunk | The storage unit for entity components. |
| EntityCommandBuffer | A buffer for recording entity modifications used to reduce structural changes. For more information see Scheduling data changes with an EntityCommandBuffer. |
| ComponentType | Define types when creating entity queries. |
| BlobBuilder | A utility class to create blob assets, which are immutable data structures that can be safely shared between jobs using BlobAssetReference instances. |
| ICustomBootstrap | An interface to implement to create your own system loop. |
| SystemAPI | Class that gives access to access to buffers, components, time, enumeration, singletons and more. This also includes any IAspect, IJobEntity, SystemBase, and ISystem. |
| Attributes | Description |
|---|---|
| UpdateInGroup | Defines the ComponentSystemGroup that a system should be added to. |
| UpdateBefore | Specifies that one system must update before another. |
| UpdateAfter | Specifies that one system must update after another |
| DisableAutoCreation | Prevents a system from being automatically discovered and run when your application starts up |
| ExecuteAlways | Specifies that a system's update function must be invoked every frame, even when no entities are returned by the system's entity query. |