App.init_resource vs App.insert_resource #20198
-
If I have a example struct |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The primary difference is that |
Beta Was this translation helpful? Give feedback.
The primary difference is that
init_resource
won't overwrite the resource if it was already inserted before. This way, you can ensure that a resource exists in one plugin, while still allowing some other plugin or user to insert a specific value. This is mostly useful for Bevy itself and third-party libraries.