#Sharing data between MonoBehaviour and ECS

1 messages · Page 1 of 1 (latest)

stark pendant
#

I'm making an A* path finding job, and it needs to use the newest map from some where MonoBahaviour. In my game, characters move around automatically and build machines themselves, so the walkable property will change. But how can I sync this change to ECS?

#

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.

tepid pine
#

If you have monobehaviour project - just make your algo bursted job.
Tying game objects with ECS will be miserable experience

stark pendant
tepid pine
#

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

stark pendant
# tepid pine NativeReference for example

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