#Sharing data between MonoBehaviour and ECS
1 messages · Page 1 of 1 (latest)
My plan is to update some List or maybe NativeList when machines or some obstacles appear on a map tile. But I don't know where I should store the List.
If you have monobehaviour project - just make your algo bursted job.
Tying game objects with ECS will be miserable experience
But if I want to use burst complier, I also need to use unmanaged types while List and HexUnit (my map tile monobehaviour class) are managed. Where should I create another NativeList or other container?
In some kind of manager I guess
It's best if you just use unmanaged containers in your mono behaviours too
NativeReference for example
this way you can easily pass them to your jobs
Or even better: index of some sort. SO you can just own index in your monob which points to some part of NativeList
Oh, I haven't know this container before. I'm gonna learn about it. Maybe I need to use a lot of unmanaged type in my project and the only thing mono do is know the index.
Thanks for your help