How can I get a system reference in a MonoBehaviour?

If I want to do some work in a MonoBehaviour on start then call a function in a system passing in some data before any systems start running, how can I do this?

Hi,

you can use :

https://docs.unity3d.com/Packages/com.unity.entities@0.17/api/Unity.Entities.World.DefaultGameObjectInjectionWorld.html#Unity_Entities_World_DefaultGameObjectInjectionWorld

and :

https://docs.unity3d.com/Packages/com.unity.entities@0.17/api/Unity.Entities.World.GetOrCreateSystem.html

2 Likes