Fix adding outline when SceneSpawner is not in the world#74
Merged
Conversation
Bevy removes it from the world when a scene is spawned via `SceneSpawner`: https://github.com/bevyengine/bevy/blob/f667c282dad2c1419afb5836ded22a3ec263970e/crates/bevy_scene/src/scene_spawner.rs#L560 If `AsyncSceneInheritOutline` is inserted during the scene spawning (via a required component or via trigger), the system won't run since it requires `SceneSpawner`. Tests use `DynamicSceneRoot` instead of using `SceneSpawner` directly and it works since it uses a bit different mechanism. I noticed this in my game and tested the fix.
c85d37d to
132fb4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bevy removes it from the world when a scene is spawned via
SceneSpawner:https://github.com/bevyengine/bevy/blob/f667c282dad2c1419afb5836ded22a3ec263970e/crates/bevy_scene/src/scene_spawner.rs#L560
If
AsyncSceneInheritOutlineis inserted during the scene spawning (via a required component or via trigger), the system won't run since it requiresSceneSpawner.Tests use
DynamicSceneRootinstead of usingSceneSpawnerdirectly and it works since it uses a bit different mechanism.I noticed this in my game and tested the fix.
Looks like the crate still uses Rust 2021, so I can't use chained if let. I tried updating, but this requires a bunch of other changes in formatting and triggers a few clippy warnings, so I kept the version as is.