How can I share asset resources between two worlds, or are they shared already? #9072
Unanswered
Architector4
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some logic I want to split into its own separate Bevy
World
, with its own schedule, run conditions, set of entities, etc, but which will use a lot of the same assets as the main one.But I want to share some resources between them, to not end up instantiating the same things multiple times into memory. For example,
Assets<Mesh>
,Assets<Image>
, and such.I tried making the second world a subapp, and then using systems to throw these resources between them as needed, but everything panics horribly on change detection systems. I'm now thinking of making the second
World
itself a resource and then running its schedules in a system of the mainWorld
or something, but I feel like I'll just run into the exact same issue again.From here, I wonder: is there a way to share these asset resources between the two worlds, one way or another? Or are the asset servers like this global and I can simply init them again on the second world without fear?
Or, alternatively, worst case scenario, I guess I could clone over the asset into the other world as needed lol
Beta Was this translation helpful? Give feedback.
All reactions