-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add an example showing how to edit a scene before it's spawned #5872
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. This also needs a Migration Guide as there are breaking changes :)
@@ -25,6 +26,18 @@ impl Scene { | |||
Self { world } | |||
} | |||
|
|||
/// Create a new scene from a given dynamic scene. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little more explanation around the type registry parameter would be appreciated.
.run(); | ||
} | ||
|
||
pub const CAKE_WITH_LIGHT_HANDLE: HandleUntyped = HandleUntyped::weak_from_u64(Scene::TYPE_UUID, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comment explaining how these constants were chosen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you believe me if I said "randomly selected value"? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grin Of course ;) Good to explain to the users though.
.despawn_recursive(); | ||
|
||
// add the modified scenes to the assets | ||
scenes.set_untracked(CAKE_WITH_LIGHT_HANDLE, scene_with_lights); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_untracked feels like a very unintuitive name for this behavior. Should it be renamed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_untracked
creates an asset that is not tracked for automatic cleanup, the name seems right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not create_untracked
then? set
to me implies that it's setting an existing asset.
Or even create_durable
or something, to better communicate the intent.
converting to draft as most comments are related to how to do asset post processing, and it's just not something that can be pretty in Bevy for now |
Objective
Scene
/DynamicScene