Method DidChange
DidChange<T>(ref ComponentTypeHandle<T>, UInt32)
Reports whether the data in any of IComponentData components in the chunk, of the type identified by
typeHandle
, could have changed since the specified version.
Declaration
public readonly bool DidChange<T>(ref ComponentTypeHandle<T> typeHandle, uint version)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | typeHandle | An object containing type and job safety information. To create this object, call GetComponentTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The component type. |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange<T>(ComponentTypeHandle<T>, UInt32)
Obsolete. Use DidChange<T>(ref ComponentTypeHandle<T>, UInt32) instead.
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly bool DidChange<T>(ComponentTypeHandle<T> typeHandle, uint version)
where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | typeHandle | An object containing type and job safety information. To create this object, call GetComponentTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The component type. |
DidChange(ref DynamicComponentTypeHandle, UInt32)
Reports whether the data in any of IComponentData components in the chunk, of the type identified by
typeHandle
, could have changed since the specified version.
Declaration
public readonly bool DidChange(ref DynamicComponentTypeHandle typeHandle, uint version)
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | typeHandle | An object containing type and job safety information. To create this object, call GetDynamicComponentTypeHandle(ComponentType). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange(DynamicComponentTypeHandle, UInt32)
Obsolete. Use DidChange(ref DynamicComponentTypeHandle, UInt32) instead.
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly bool DidChange(DynamicComponentTypeHandle typeHandle, uint version)
Parameters
Type | Name | Description |
---|---|---|
DynamicComponentTypeHandle | typeHandle | An object containing type and job safety information. To create this object, call GetDynamicComponentTypeHandle(ComponentType). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
DidChange<T>(ref BufferTypeHandle<T>, UInt32)
Reports whether any of the data in dynamic buffer components in the chunk, of the type identified by
bufferTypeHandle
, could have changed since the specified version.
Declaration
public readonly bool DidChange<T>(ref BufferTypeHandle<T> bufferTypeHandle, uint version)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | bufferTypeHandle | An object containing type and job safety information. To create this object, call GetBufferTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The data type of the elements in the dynamic buffer. |
Remarks
When you access a component in a chunk with write privileges, the ECS framework updates the change version of that component type to the current GlobalSystemVersion value. Since every system stores the global system version in its LastSystemVersion field when it updates, you can compare these two versions with this function in order to determine whether the data of components in this chunk could have changed since the last time that system ran.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange<T>(BufferTypeHandle<T>, UInt32)
Obsolete. Use DidChange<T>(ref BufferTypeHandle<T>, UInt32) instead.
Declaration
[Obsolete("The bufferTypeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly bool DidChange<T>(BufferTypeHandle<T> bufferTypeHandle, uint version)
where T : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
BufferTypeHandle<T> | bufferTypeHandle | An object containing type and job safety information. To create this object, call GetBufferTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The data type of the elements in the dynamic buffer. |
DidChange<T>(SharedComponentTypeHandle<T>, UInt32)
Reports whether the value of shared components associated with the chunk, of the type identified by
chunkSharedComponentData
, could have changed since the specified version.
Declaration
public readonly bool DidChange<T>(SharedComponentTypeHandle<T> chunkSharedComponentData, uint version)
where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
SharedComponentTypeHandle<T> | chunkSharedComponentData | An object containing type and job safety information. To create this object, call GetSharedComponentTypeHandle<T>(). Pass the object to a job using a public field you define as part of the job struct. |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion at the time the job is run or scheduled. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
Shared components behave differently than other types of components in terms of change versioning because changing the value of a shared component can move an entity to a different chunk. If the change results in an entity moving to a different chunk, then only the order version is updated (for both the original and the receiving chunk). If you change the shared component value for all entities in a chunk at once, the change version for that chunk is updated. The order version is unaffected.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange(ref DynamicSharedComponentTypeHandle, UInt32)
Reports whether the value of shared components associated with the chunk, of the type identified by
typeHandle
, could have changed since the specified version.
Declaration
public readonly bool DidChange(ref DynamicSharedComponentTypeHandle typeHandle, uint version)
Parameters
Type | Name | Description |
---|---|---|
DynamicSharedComponentTypeHandle | typeHandle | An object containing type and job safety information. To create this object, call GetDynamicSharedComponentTypeHandle(ComponentType). |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |
Remarks
Shared components behave differently than other types of components in terms of change versioning because changing the value of a shared component can move an entity to a different chunk. If the change results in an entity moving to a different chunk, then only the order version is updated (for both the original and the receiving chunk). If you change the shared component value for all entities in a chunk at once, the change version for that chunk is updated. The order version is unaffected.
Note that for efficiency, the change version applies to whole chunks not individual entities. The change version is updated even when another job or system that has declared write access to a component does not actually change the component value.
DidChange(DynamicSharedComponentTypeHandle, UInt32)
Obsolete. Use DidChange(ref DynamicSharedComponentTypeHandle, UInt32)
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly bool DidChange(DynamicSharedComponentTypeHandle typeHandle, uint version)
Parameters
Type | Name | Description |
---|---|---|
DynamicSharedComponentTypeHandle | typeHandle | An object containing type and job safety information. To create this object, call GetDynamicSharedComponentTypeHandle(ComponentType). |
UInt32 | version | The version to compare. In a system, this parameter should be set to the current LastSystemVersion. |
Returns
Type | Description |
---|---|
Boolean | True, if the version number stored in the chunk for this component is more recent than the version
passed to the |