Skip to content

Add app.add_state(inital_state) convenience method #10731

@honungsburk

Description

@honungsburk

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

I want to initialize a state to an arbitrary state, not just default.

Right now I am using app.add_state::<MyState>()

What solution would you like?

Add a convenience method app.add_state(MyState::MyArbitraryState) to App

What alternative(s) have you considered?

I read through the motivation for the new state system but it doesn't mention why only the default trait is used for initialization. This seems like a clear win to me so I would be surprised at any objections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions