Is there a reason for not having managed singleton API? Or are managed components just a new addition not fully supported yet?
You can use GetSingletonEntity of a managed component class to get the entity and then get the component with GetComponentData. But GetSingleton directly is only available for structs.
Yes, thank you. I'm aware of that, but I'm wondering if that is just a temporary limitation or if there is a good reason to not have managed singleton API.
Yes would be really nice to have these functions Code (CSharp): public T GetSingleton<T>() where T : struct, IComponentData; public bool HasSingleton<T>() where T : struct, IComponentData; public void SetSingleton<T>(T value) where T : struct, IComponentData; no restricted to structs only. These functions are working already: Code (CSharp): public Entity GetSingletonEntity<T>(); public void RequireSingletonForUpdate<T>();
Because SystemAPI has inner ManagedAPI for that. Code (CSharp): SystemAPI.ManagedAPI.GetSingletonEntity