Documentation

Unity Engine

Unity Engine

SystemAPI

Giving quick and consistent access to buffers, components, time, enumeration, singletons and more. This includes any IJobEntity, SystemBase, and ISystem. Suggested usage is: @@@@@@cs using static Unity.Entities.SystemAPI; [...] partial struct SomeJob: IJobEntity { void Execute(ref EcsTestData e1) =\> e1.value += Time.deltaTime; } @@@@@@
Read time 4 minutesLast updated 7 days ago

Definition

  • Type: Class
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static class SystemAPI

Static Properties

Property

Description

TimeThe current Time data for calling system's world.

Static Methods

Method

Description

ExistsChecks if the entity exists inside this system's EntityManager.
GetBufferGets the dynamic buffer of an entity.
GetBufferLookupGets a BufferLookup\<T\> object that can access a DynamicBuffer<T>.
GetBufferTypeHandleGets the run-time type information required to access an array of buffer components in a chunk.
GetComponentLook up the value of a component for an entity.
GetComponentLookupGets a dictionary-like container containing all components of type T, keyed by Entity.
GetComponentROGets a reference to a component for an entity, for read-only access.
GetComponentRWGets a reference to a component for an entity, for read/write access.
GetComponentTypeHandleGets the run-time type information required to access an array of component data in a chunk.
GetEntityStorageInfoLookupGets a EntityStorageInfoLookup object that can access a EntityStorageInfo.
GetEntityTypeHandleGets the run-time type information required to access the array of Entity objects in a chunk.
GetSharedComponentTypeHandleGets the run-time type information required to access a shared component data in a chunk.
GetSingletonGets the value of a singleton component.
GetSingletonBufferGets the value of a singleton buffer component.
GetSingletonEntityGets the Entity instance for a singleton.
GetSingletonRWGets a reference to the singleton component, for read/write access.
HasBufferChecks whether an entity has a dynamic buffer of a specific IBufferElementData type.
HasComponentChecks whether an entity has a specific type of component.
HasSingletonChecks whether a singleton component of the specified type exists.
IsBufferEnabledChecks whether the IBufferElementData of type T is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
IsComponentEnabledChecks whether the IComponentData of type T is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
QueryGet Enumerable for iterating through Component types from inside a system
QueryBuilderGives a fluent API for constructing EntityQuerys similar to the EntityQueryBuilder. This API statically constructs the query as part of the system, and creates the query in the system's OnCreate. Calling this method should allow the construction of EntityQueries with almost no run-time performance overhead."
SetBufferEnabledEnable or disable the IBufferElementData of type T on the specified Entity. This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
SetComponentSets the value of a component of an entity.
SetComponentEnabledEnable or disable the IComponentData of type T on the specified Entity. This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
SetSingletonSets the value of a singleton component.
TryGetComponentTry to look up the value of a component for an entity.
TryGetSingletonGets the value of a singleton component, and returns whether or not a singleton component of the specified type exists in the World.
TryGetSingletonBufferGets the value of a singleton buffer component, and returns whether or not a singleton buffer component of the specified type exists in the World.
TryGetSingletonEntityGets the singleton Entity, and returns whether or not a singleton Entity of the specified type exists in the World.
TryGetSingletonRWGets the value of a singleton component, and returns whether or not a singleton component of the specified type exists in the World.