Skip to content

Add world and world_mut methods to RelatedSpawner #18880

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

Merged

Conversation

urben1680
Copy link
Contributor

@urben1680 urben1680 commented Apr 19, 2025

Objective

RelatedSpawnerCommands offers methods to get the underlying Commands.
RelatedSpawner does not expose the inner World reference so far.

I currently want to write extension traits for both of them but I need to duplicate the whole API for the latter because I cannot get it's &mut World.

Solution

Add methods for immutable and mutable World access

@janhohenheim janhohenheim added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 19, 2025
@janhohenheim janhohenheim added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 20, 2025
@mockersf
Copy link
Member

this makes it easier to do changes to the world unrelated to relations or to the target entity

@mockersf mockersf added the X-Contentious There are nontrivial implications that should be thought through label Apr 26, 2025
@urben1680
Copy link
Contributor Author

From which point of view would this be problematic? It should be safe since it is not a UnsafeWorldCell that is wrapped there.

@alice-i-cecile alice-i-cecile added this to the 0.16.1 milestone May 6, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 6, 2025
Merged via the queue into bevyengine:main with commit 2ae1510 May 6, 2025
44 checks passed
@urben1680 urben1680 deleted the related-spawner-world-getter branch May 8, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants