-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 by Bors] - Reflect Default for ComputedVisibility
and Handle<T>
#6187
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.
Shouldn't we have a Default trait impl for this reflection to work? Or at least for consistency.
Yes, both types already had |
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.
Thanks for the explanation; it wasn't visible in the code review pane :)
Merging as trivial. bors r+ |
# Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
Pull request successfully merged into main. Build succeeded: |
ComputedVisibility
and Handle<T>
ComputedVisibility
and Handle<T>
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as #6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
Objective
Default
is required for scripts to createReflect
types at runtime with no static type information.Default
onHandle<T>
andComputedVisibility
should allow scripts frombevy_mod_js_scripting
to actually spawn sprites from scratch, without needing any hand-holding from the host-game.Solution
ReflectDefault
forHandle<T>
andComputedVisiblity
.Changelog
Default
trait is now reflected forHandle<T>
andComputedVisibility