Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#
Method group is Obsolete

ComponentSystemBase.GetSingletonRW

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

Obsolete Use SystemAPI.GetSingletonRW instead (RemovedAfter Entities 1.0).

Declaration

public RefRW<T> GetSingletonRW();

Returns

RefRW<T> The component.

Description

Gets a reference to the singleton component, for read/write access.

NOTE: this reference refers directly to the singleton's component memory. Structural changes to the chunk where the singleton resides can invalidate this reference and result in crashes or undefined behaviour if the reference is used after structural changes.

Additional resources: ComponentSystemBase.GetSingleton, EntityQuery.GetSingleton, EntityQuery.GetSingletonRW