Skip to content

Add ability to ignore field of bundle #5559

@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

Add the ability to ignore a field of a bundle using the #[derive(Bundle)] macro, causing it to not be included in the generated list of components.

This is primarily useful when working with PhantomData.

What solution would you like?

#[derive(Bundle)]
struct GenericBundle<T>{
 transform: Transform,
  #[bundle(ignore)]
  _phantom: PhantomData<T>,
}

Modify the derive Bundle macro to accomplish this :)

Be sure to add this to the Bundle docs as a doc test so this keeps working and can be discovered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions