Skip to content

0.11.0

Latest
Compare
Choose a tag to compare
@mintlu8 mintlu8 released this 21 May 09:18
· 29 commits to main since this release

Features

  • Direct World Access

World is now a mutable thread local using scoped_tls_hkt, this mean all (non-watch) access are now immediate and not deferred. Because of this default_settings now only runs once per frame on update. This makes bevy_defer significantly more consistent but less parallelizable with other systems. Use bevy_tasks if blocking/cpu intensive operations are needed.

Before:

entity.component<Transform>().set(|x| x.translation = v).await?

After:

entity.component<Transform>().set(|x| x.translation = v)?
  • Derive AsyncComponent and AsyncResource.

Traits for extension methods can now be derived.

  • Attribute macro async_access.

A macro that mirrors methods with 'static results to async accessors.

#[async_access]
impl MyTransform {
    fn get_translation(&self) -> Vec3 { ... }
}

async_entity.component::<MyTransform>().get_translation()?
  • BeforeAsyncExecutor schedule

We now have a dedicated schedule to run reactors in.
Extension methods react_to_* exist on App to add these reactors to Event, State and Component change.
In addition, react_to_scene_load, react_to_animation and react_to_ui are automatically added with their features enabled.

  • Better Error Handling

Added a mini anyhow::Error called CustomError that works nicely with the standard AccessError and bevy_log.

Deprecations

  • world() has been replaced by AsyncWorld. Most top level methods like spawn() are deprecated and moved to AsyncWorld. This can help prevent confusing errors if you have dependencies like smol or tokio with their own spawns.

  • AsyncFailure has been replace by AccessError and CustomError.

  • bevy_mod_picking support now lives in a separate crate.

  • The ability to create thread locals have been removed, since the world is now mutably accessible.