Method GetSharedComponentIndex
GetSharedComponentIndex<T>(SharedComponentTypeHandle<T>)
Gets the index into the array of unique values for the specified shared component.
Declaration
public readonly int GetSharedComponentIndex<T>(SharedComponentTypeHandle<T> chunkSharedComponentData) where T : struct, ISharedComponentData
Parameters
Type | Name | Description |
---|---|---|
Shared |
chunkSharedComponentData | An object containing type and job safety information. To create this
object, call Get |
Returns
Type | Description |
---|---|
int | The index value, or -1 if the chunk does not contain a shared component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the shared component. |
Remarks
Because shared components can contain managed types, you can only access the value index of a shared component
inside a job, not the value itself. The index value indexes the array returned by
Get
GetSharedComponentIndex(ref DynamicSharedComponentTypeHandle)
Gets the index into the array of unique values for the specified shared component.
Declaration
public readonly int GetSharedComponentIndex(ref DynamicSharedComponentTypeHandle typeHandle)
Parameters
Type | Name | Description |
---|---|---|
Dynamic |
typeHandle | An object containing type and job safety information. To create this
object, call Get |
Returns
Type | Description |
---|---|
int | The index value, or -1 if the chunk does not contain a shared component of the specified type. |
Remarks
Because shared components can contain managed types, you can only access the value index of a shared component
inside a job, not the value itself. The index value indexes the array returned by
Get
GetSharedComponentIndex(DynamicSharedComponentTypeHandle)
Obsolete. Use Get
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly int GetSharedComponentIndex(DynamicSharedComponentTypeHandle typeHandle)
Parameters
Type | Name | Description |
---|---|---|
Dynamic |
typeHandle | An object containing type and job safety information. To create this
object, call Get |
Returns
Type | Description |
---|---|
int | The index value, or -1 if the chunk does not contain a shared component of the specified type. |