Option for the plugin to skip setting an initial state #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
While integrating this into a template which used
bevy_asset_loader
I found that there was a little bit of friction as both plugins wanted to manage state. In particular, the leafwingManifestPlugin
automatically sets the game toAssetLoadingState::LOADING
when the plugin is added. I still wantleafwing_manifest
to manage manifest processing states, but I don't want it to control my application setup which seems to be the current behaviour.I think this is different from
automatically_advance_states
, in that Having this allows me to explicitly control when I hand over control of the application state toleafwing_manifest
by triggering the right state transition. (Its definitely possible I've missed a more obvious approach😁)Changes
The default behaviour is unchanged. The changes are:
set_initial_state
flag toManifestPlugin
, which defaults totrue
,ManifestPlugin::build
checkset_initial_state
istrue
before callingapp.insert_state(S::LOADING)
.Default
impl forManifestPlugin
generic acrossAssetLoadingState
s, which might resolve ManifestPlugin'sDefault
impl is specific toSimpleAssetState
#46 ?