# ComponentSystemBase

> A system provides behavior in an ECS architecture.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public abstract class ComponentSystemBase
```

## Remarks

System implementations should inherit [SystemBase](/engine/7000.0/script-reference/unity/entities/systembase.md), which is a subclass of ComponentSystemBase.

## Constructors

| Constructor                                                                                         | Description                                      |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [ComponentSystemBase()](/engine/7000.0/script-reference/unity/entities/componentsystembase/ctor.md) | Initializes and returns an instance of a system. |

## Properties

| Property                                                                                                           | Description                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Enabled](/engine/7000.0/script-reference/unity/entities/componentsystembase/enabled.md)                           | Controls whether this system executes when its OnUpdate function is called.                                                                                           |
| [EntityManager](/engine/7000.0/script-reference/unity/entities/componentsystembase/entitymanager.md)               | The EntityManager object of the [ComponentSystemBase.World](/engine/7000.0/script-reference/unity/entities/componentsystembase/world.md) in which this system exists. |
| [EntityQueries](/engine/7000.0/script-reference/unity/entities/componentsystembase/entityqueries.md)               | The query objects cached by this system.                                                                                                                              |
| [GlobalSystemVersion](/engine/7000.0/script-reference/unity/entities/componentsystembase/globalsystemversion.md)   | The current change version number in this [ComponentSystemBase.World](/engine/7000.0/script-reference/unity/entities/componentsystembase/world.md).                   |
| [LastSystemVersion](/engine/7000.0/script-reference/unity/entities/componentsystembase/lastsystemversion.md)       | The current version of this system.                                                                                                                                   |
| [SystemHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/systemhandle.md)                 | The SystemHandle of this system.                                                                                                                                      |
| [World](/engine/7000.0/script-reference/unity/entities/componentsystembase/world.md)                               | The World in which this system exists.                                                                                                                                |
| [WorldUpdateAllocator](/engine/7000.0/script-reference/unity/entities/componentsystembase/worldupdateallocator.md) | Retrieve world update allocator from system state.                                                                                                                    |

## Methods

| Method                                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [GetBufferLookup](/engine/7000.0/script-reference/unity/entities/componentsystembase/getbufferlookup.md)                                         | Manually gets a BufferLookup\\\<T\\> object that can access a [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md).                                                                                                                                                                               |
| [GetBufferTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getbuffertypehandle.md)                                 | Manually gets the run-time type information required to access an array of buffer components in a chunk.                                                                                                                                                                                                                           |
| [GetComponentLookup](/engine/7000.0/script-reference/unity/entities/componentsystembase/getcomponentlookup.md)                                   | Manually gets a dictionary-like container containing all components of type T, keyed by Entity.                                                                                                                                                                                                                                    |
| [GetComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getcomponenttypehandle.md)                           | Manually gets the run-time type information required to access an array of component data in a chunk.                                                                                                                                                                                                                              |
| [GetDynamicComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getdynamiccomponenttypehandle.md)             | Manually gets the run-time type information required to access an array of component data in a chunk.                                                                                                                                                                                                                              |
| [GetDynamicSharedComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getdynamicsharedcomponenttypehandle.md) | Manually gets the run-time type information required to access a shared component data in a chunk.                                                                                                                                                                                                                                 |
| [GetEntityQuery](/engine/7000.0/script-reference/unity/entities/componentsystembase/getentityquery.md)                                           | Gets the cached query for the specified component types, if one exists; otherwise, creates a new query instance and caches it.                                                                                                                                                                                                     |
| [GetEntityStorageInfoLookup](/engine/7000.0/script-reference/unity/entities/componentsystembase/getentitystorageinfolookup.md)                   | Manually gets an EntityStorageInfoLookup object that can access a [EntityStorageInfo](/engine/7000.0/script-reference/unity/entities/entitystorageinfo.md).                                                                                                                                                                        |
| [GetEntityTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getentitytypehandle.md)                                 | Manually gets the run-time type information required to access the array of [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) objects in a chunk.                                                                                                                                                                 |
| [GetSharedComponentTypeHandle](/engine/7000.0/script-reference/unity/entities/componentsystembase/getsharedcomponenttypehandle.md)               | Manually gets the run-time type information required to access a shared component data in a chunk.                                                                                                                                                                                                                                 |
| [OnCreate](/engine/7000.0/script-reference/unity/entities/componentsystembase/oncreate.md)                                                       | Called when this system is created.                                                                                                                                                                                                                                                                                                |
| [OnDestroy](/engine/7000.0/script-reference/unity/entities/componentsystembase/ondestroy.md)                                                     | Called when this system is destroyed.                                                                                                                                                                                                                                                                                              |
| [OnStartRunning](/engine/7000.0/script-reference/unity/entities/componentsystembase/onstartrunning.md)                                           | Called before the first call to OnUpdate and when a system resumes updating after being stopped or disabled.                                                                                                                                                                                                                       |
| [OnStopRunning](/engine/7000.0/script-reference/unity/entities/componentsystembase/onstoprunning.md)                                             | Called when this system stops running because no entities match the system's [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) objects or because you change the system [ComponentSystemBase.Enabled](/engine/7000.0/script-reference/unity/entities/componentsystembase/enabled.md) property to false. |
| [RequireAnyForUpdate](/engine/7000.0/script-reference/unity/entities/componentsystembase/requireanyforupdate.md)                                 | Provide a set of queries, one of which must match entities for the system to run.                                                                                                                                                                                                                                                  |
| [RequireForUpdate](/engine/7000.0/script-reference/unity/entities/componentsystembase/requireforupdate.md)                                       | Adds a query that must match entities for the system to run. You can add multiple required queries to a system; all of them must match at least one entity for the system to run.                                                                                                                                                  |
| [ShouldRunSystem](/engine/7000.0/script-reference/unity/entities/componentsystembase/shouldrunsystem.md)                                         | Reports whether this system satisfies the criteria to update. This function is used internally to determine whether the system's OnUpdate function can be skipped.                                                                                                                                                                 |
| [Update](/engine/7000.0/script-reference/unity/entities/componentsystembase/update.md)                                                           | Executes the system immediately.                                                                                                                                                                                                                                                                                                   |
