You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means it's impossible express bundles with "optional components". The workaround is to create distinct types for variations with/without the optional components:
Ideally, bundles should allow optional components/bundles as their members. This would eliminate some code duplication for the user and allow them to express optional components more explicitly and ergonomically.
During insertion, the bundle could check for None values and not insert those components.
During removal, the component would be removed if it exists, which I believe is already the existing behavior.
The text was updated successfully, but these errors were encountered:
Duplicate of bevyengine/bevy#2157 <3 This is the website for the book / release notes etc, not the engine, so that's probably why you didn't find the duplicate.
As Bevy 0.11, this does not compile:
This means it's impossible express bundles with "optional components". The workaround is to create distinct types for variations with/without the optional components:
Ideally, bundles should allow optional components/bundles as their members. This would eliminate some code duplication for the user and allow them to express optional components more explicitly and ergonomically.
During insertion, the bundle could check for
None
values and not insert those components.During removal, the component would be removed if it exists, which I believe is already the existing behavior.
The text was updated successfully, but these errors were encountered: