Documentation

Unity Engine

Unity Engine

ComponentSystemBase

A system provides behavior in an ECS architecture.
Read time 2 minutesLast updated 5 days ago

Definition

  • Type: Class
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public abstract class ComponentSystemBase

Remarks

System implementations should inherit SystemBase, which is a subclass of ComponentSystemBase.

Constructors

Constructor

Description

ComponentSystemBase()Initializes and returns an instance of a system.

Properties

Property

Description

EnabledControls whether this system executes when its OnUpdate function is called.
EntityManagerThe EntityManager object of the ComponentSystemBase.World in which this system exists.
EntityQueriesThe query objects cached by this system.
GlobalSystemVersionThe current change version number in this ComponentSystemBase.World.
LastSystemVersionThe current version of this system.
SystemHandleThe SystemHandle of this system.
WorldThe World in which this system exists.
WorldUpdateAllocatorRetrieve world update allocator from system state.

Methods

Method

Description

GetBufferLookupManually gets a BufferLookup\<T\> object that can access a DynamicBuffer<T>.
GetBufferTypeHandleManually gets the run-time type information required to access an array of buffer components in a chunk.
GetComponentLookupManually gets a dictionary-like container containing all components of type T, keyed by Entity.
GetComponentTypeHandleManually gets the run-time type information required to access an array of component data in a chunk.
GetDynamicComponentTypeHandleManually gets the run-time type information required to access an array of component data in a chunk.
GetDynamicSharedComponentTypeHandleManually gets the run-time type information required to access a shared component data in a chunk.
GetEntityQueryGets the cached query for the specified component types, if one exists; otherwise, creates a new query instance and caches it.
GetEntityStorageInfoLookupManually gets an EntityStorageInfoLookup object that can access a EntityStorageInfo.
GetEntityTypeHandleManually gets the run-time type information required to access the array of Entity objects in a chunk.
GetSharedComponentTypeHandleManually gets the run-time type information required to access a shared component data in a chunk.
OnCreateCalled when this system is created.
OnDestroyCalled when this system is destroyed.
OnStartRunningCalled before the first call to OnUpdate and when a system resumes updating after being stopped or disabled.
OnStopRunningCalled when this system stops running because no entities match the system's EntityQuery objects or because you change the system ComponentSystemBase.Enabled property to false.
RequireAnyForUpdateProvide a set of queries, one of which must match entities for the system to run.
RequireForUpdateAdds 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.
ShouldRunSystemReports whether this system satisfies the criteria to update. This function is used internally to determine whether the system's OnUpdate function can be skipped.
UpdateExecutes the system immediately.