You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code above adds identical Mesh and Material entities to Assets<_> every time it's called. I'm wondering if the data stored in mesh remains even after bullets are despawned, potentially accumulating throughout the game.
When I searched for a way to handle these kinds of assets, I found some projects in which Handle<_> for those assets is kept in Res<_> and reused:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I need your advice on how to handle assets properly and efficiently.
I wrote a function that spawns a bullet entity on the screen:
The code above adds identical
Mesh
andMaterial
entities toAssets<_>
every time it's called. I'm wondering if the data stored in mesh remains even after bullets are despawned, potentially accumulating throughout the game.When I searched for a way to handle these kinds of assets, I found some projects in which
Handle<_>
for those assets is kept inRes<_>
and reused:From an efficiency standpoint, which approach is more preferable? Is there a more preferable way?
Beta Was this translation helpful? Give feedback.
All reactions