#How to access Managed IComponentData in an ISystem?

1 messages · Page 1 of 1 (latest)

reef garnet
#

Hey! 👋

I have this managed component that would be a singleton (reusable by many systems):

{
    public Entity BulletEntityPrefab;
    public GameObject BulletCompanionPrefab;
}```

I am not sure how can I access it inside a system since:
```weaponConfig = SystemAPI.GetSingleton<WeaponConfigGlobalComponent>();```
doesn't allow accessing Managed components 🤔 

Maybe my design is incorrect. The idea was to have a "Config" object that has bullet Entity and visualisation (GameObject) so that different systems can create a bullet entity and a "companion object" that follows the entity.

How would I go about finding my managed component "singleton" in a system Is there a different / better way to access the bullet GameObject visualisation for the purpose of creating a companion object?  🙂
#

How to access Managed IComponentData in an ISystem?

reef garnet
trim breach
#

But you won’t be able to access them in a burst context.