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

EntityManager.GetSharedComponent

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

Declaration

public T GetSharedComponent(Entity entity);

Parameters

Parameter Description
entity The entity.

Returns

T A copy of the shared component.

Description

Gets a shared component from an entity.


Declaration

public T GetSharedComponent(int sharedComponentIndex);

Parameters

Parameter Description
sharedComponentIndex The index of the shared component in the internal shared component list.

Returns

T A copy of the shared component.

Description

Gets a shared component by index.

The ECS framework maintains an internal list of unique shared components. You can get the components in this list, along with their indices using EntityManager.GetAllUniqueSharedComponents. An index in the list is valid and points to the same shared component index as long as the shared component order version from EntityManager.GetSharedComponentOrderVersion remains the same.