Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to remove component from render world if not extracted. (#15904)
# Objective Ensure that components that are conditionally extracted do not linger in the render world when not extracted from the main world. ## Solution If the `ExtractComponent` returns `None`, we'll remove the render world component. I think this is the most sensible behavior here. In the future if there really is a use case for keeping the previous render component around, we could add a `Option<Self::Out>` parameter for the previous render component to the method, or something similar. I think that this follows the principle of least surprise here relative to what `None` would suggest and the way that render nodes are typically written. The alternative would be to add an `enabled` field to pretty much every camera settings component, or duplicate the extraction condition as #15856 does. ## Testing `transmission` no longer crashes. ## Migration Guide Components that implement `ExtractComponent` and return `None` will cause the extracted component to be removed from the render world.
- Loading branch information