Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

SystemAPI

class in Unity.Entities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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; } @@@@

Static Properties

Property Description
Time The current Time data for calling system's world.

Static Methods

Method Description
Exists Checks if the entity exists inside this system's EntityManager.
GetBuffer Gets the dynamic buffer of an entity.
GetBufferLookup Gets a BufferLookup<T> object that can access a DynamicBuffer<T0>.
GetBufferTypeHandle Gets the run-time type information required to access an array of buffer components in a chunk.
GetComponent Look up the value of a component for an entity.
GetComponentLookup Gets a dictionary-like container containing all components of type T, keyed by Entity.
GetComponentRO Gets a reference to a component for an entity, for read-only access.
GetComponentRW Gets a reference to a component for an entity, for read/write access.
GetComponentTypeHandle Gets the run-time type information required to access an array of component data in a chunk.
GetEntityStorageInfoLookup Gets a EntityStorageInfoLookup object that can access a EntityStorageInfo.
GetEntityTypeHandle Gets the run-time type information required to access the array of Entity objects in a chunk.
GetSharedComponentTypeHandle Gets the run-time type information required to access a shared component data in a chunk.
GetSingleton Gets the value of a singleton component.
GetSingletonBuffer Gets the value of a singleton buffer component.
GetSingletonEntity Gets the Entity instance for a singleton.
GetSingletonRW Gets a reference to the singleton component, for read/write access.
HasBuffer Checks whether an entity has a dynamic buffer of a specific IBufferElementData type.
HasComponent Checks whether an entity has a specific type of component.
HasSingleton Checks whether a singleton component of the specified type exists.
IsBufferEnabled Checks 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.
IsComponentEnabled Checks 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.
Query Get Enumerable for iterating through Component types from inside a system
QueryBuilder Gives 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."
SetBufferEnabled Enable 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.
SetComponent Sets the value of a component of an entity.
SetComponentEnabled Enable 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.
SetSingleton Sets the value of a singleton component.
TryGetComponent Try to look up the value of a component for an entity.
TryGetSingleton Gets the value of a singleton component, and returns whether or not a singleton component of the specified type exists in the World.
TryGetSingletonBuffer Gets the value of a singleton buffer component, and returns whether or not a singleton buffer component of the specified type exists in the World.
TryGetSingletonEntity Gets the singleton Entity, and returns whether or not a singleton Entity of the specified type exists in the World.
TryGetSingletonRW Gets the value of a singleton component, and returns whether or not a singleton component of the specified type exists in the World.