NiklasEi / bevy_asset_loader

Bevy plugin helping with asset loading and organization
Apache License 2.0
481 stars 53 forks source link

Update development branch to Bevy 0.11-dev #132

Closed eerii closed 1 year ago

eerii commented 1 year ago

This bumps the bevy_main branch with added support for the current development version of bevy, as well as the new commits from the main branch.

The most notable change is the deprecation of add_system in favor of a more general add_systems that takes the schedule as a first parameter bevyengine/bevy#8079. All the examples, tests and source files were revised with this new standard.

Base sets are no longer needed so LoadingStateSet was removed. However, with bevyengine/bevy#8079 the ability to order sets between schedules was lost. Since the work that was done with the base set had ro be run after StateTransition, I added them to the Update stage, and it seems to work fine. However, if more fine control is needed, a new schedule can be created for them and using MainScheduleOrder it can be placed between StateTransition and Update. However, ordering sets between existing schedules seems to be encouraged.

Another change is that State now can't be accessed directly through its tuple field. A new .get() method can be used to get a reference. This works fine in most places, but reset_loading_state and run_loading_state were previously mutating the state through this field, which now is not allowed. The proposed workaround is to remove the internal state resource and add it again with the value we want. I am unsure if this is the best way to do it but couldn't find another that worked.

Other than that, all examples and tests were ran and everything seems to be working fine.

Note: While the bevy_common_assets dependency has already merged the update to bevy_main, the IyesGames/iyes_progress#23 PR is still in progress, so for now the Cargo.toml links to my fork's branch. This has to be changed once the PR is merged.

eerii commented 1 year ago

Sorry, I forgot to test with features enabled and one OnUpdate slipped by, should be fixed now.

eerii commented 1 year ago

Absolutely, it is added back on. Let me know if there is anything else you want me to check! I also updated it to match the last main commits.

NiklasEi commented 1 year ago

Thank you :)