SystemAPI.TryGetSingletonEntity
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
Declaration
public static bool TryGetSingletonEntity(out Entity value);
Parameters
| Parameter |
Description |
| value |
The Entity associated with the specified singleton component.
If a singleton of the specified types does not exist in the current World, this is set to Entity.Null |
Returns
bool
True, if exactly one Entity exists in the World with the provided component type.
Description
Gets the singleton Entity, and returns whether or not a singleton Entity of the specified type exists in the World.
Not working in Entities.ForEach, IJobEntity, and Utility methods