-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Reconsider removing WorldCell
#12549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I took some time and removed |
Note that I'm in favor of the third option. Though it's a bit unwieldy to use right now, it offers the best option to provide safe and performant access at runtime, it logically scales well as users are already familiar with the system param DSL, it lets us maintain less code (by removing the need for WorldCell), and supports more than just resources (really any arbitrary SystemParam, including Queries). |
Agreed on the third option as the standard migration path. This is what I use in my own code (or sometimes resource_scope if the pattern supports it). A fully fleshed out version built out of |
# Objective Fixes #12549. WorldCell's support of everything a World can do is incomplete, and represents an alternative, potentially confusing, and less performant way of pulling multiple fetches from a `World`. The typical approach is to use `SystemState` for a runtime cached and safe way, or `UnsafeWorldCell` if the use of `unsafe` is tolerable. ## Solution Remove it! --- ## Changelog Removed: `WorldCell` Removed: `World::cell` ## Migration Guide `WorldCell` has been removed. If you were using it to fetch multiple distinct values from a `&mut World`, use `SystemState` by calling `SystemState::get` instead. Alternatively, if `SystemState` cannot be used, `UnsafeWorldCell` can instead be used in unsafe contexts.
Originally posted by @james7132 in #3939 (comment)
The text was updated successfully, but these errors were encountered: