#calling a method on a SystemBase from a MonoBehaviour?
1 messages · Page 1 of 1 (latest)
absolutely horrible design wise and breaks jobs scheduling
Its for UI toolkit
Thats the thing, how do I get a static reference if I can't get reference to GO, unless there is a way to get GO reference, if so, h o w
public static MyType instance;
Awake() { instance = this; }
or
Object.FindObjectOfType<MyType>()
There are times we have to pass data from Mono world to ECS world. Currently I don't directly inject that data into the ECS components, but I use some persistent collections to cache the data from Mono world (I use pubsub for this). The SystemBase Update will retrieve data from those collections then schedule jobs normally. SystemBase Update runs on main thread anyways, we don't have to worry about race condition. But don't ever pass those persistent collections to jobs, allocate other collections if your jobs require them.
How do you fetch a populated native list from mono world into a System?
For example something like this