Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bevy 0.12 #108

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_tweening"
version = "0.8.0"
version = "0.9.0"
authors = ["François Mockers <[email protected]>", "Jerome Humbert <[email protected]>"]
edition = "2021"
description = "Tweening animation plugin for the Bevy game engine"
Expand All @@ -25,10 +25,10 @@ bevy_text = ["bevy/bevy_text", "bevy/bevy_render", "bevy/bevy_sprite"]

[dependencies]
interpolation = "0.2"
bevy = { version = "0.11", default-features = false }
bevy = { version = "0.12", default-features = false }

[dev-dependencies]
bevy-inspector-egui = "0.19"
bevy-inspector-egui = "0.21"

[[example]]
name = "menu"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add to `Cargo.toml`:

```toml
[dependencies]
bevy_tweening = "0.8"
bevy_tweening = "0.9"
```

This crate supports the following features:
Expand Down Expand Up @@ -327,6 +327,7 @@ Compatibility of `bevy_tweening` versions:

| `bevy_tweening` | `bevy` |
| :-- | :-- |
| `0.9` | `0.12` |
| `0.8` | `0.11` |
| `0.7` | `0.10` |
| `0.6` | `0.9` |
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ criterion = { version = "0.4", features = ["html_reports"] }
bevy_tweening = { path = "../" }

[dependencies.bevy]
version = "0.11"
version = "0.12"
default-features = false
features = ["bevy_render", "bevy_sprite", "bevy_text", "bevy_ui"]

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ mod tests {
}

#[cfg(feature = "bevy_asset")]
#[derive(Debug, Default, Reflect, TypeUuid)]
#[derive(Asset, Debug, Default, Reflect, TypeUuid)]
#[uuid = "a33abc11-264e-4bbb-82e8-b87226bb4383"]
struct DummyAsset {
value: f32,
Expand Down
8 changes: 2 additions & 6 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ mod tests {
pub fn new<T: Component>(animator: T) -> Self {
let mut world = World::new();
world.init_resource::<Events<TweenCompleted>>();

let mut time = Time::default();
time.update();
world.insert_resource(time);
world.init_resource::<Time>();

let entity = world.spawn((Transform::default(), animator)).id();

Expand All @@ -178,8 +175,7 @@ mod tests {
// Simulate time passing by updating the simulation time resource
{
let mut time = self.world.resource_mut::<Time>();
let last_update = time.last_update().unwrap();
time.update_with_instant(last_update + duration);
time.advance_by(duration);
}

// Reset world-related change detection
Expand Down
8 changes: 4 additions & 4 deletions src/tweenable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{ops::DerefMut, time::Duration};
use bevy::prelude::*;

#[cfg(feature = "bevy_asset")]
use bevy::asset::{Asset, HandleId};
use bevy::asset::{Asset, AssetId};

use crate::{EaseMethod, Lens, RepeatCount, RepeatStrategy, TweeningDirection};

Expand Down Expand Up @@ -234,7 +234,7 @@ impl<'a, T: Asset> AssetTarget<'a, T> {
pub fn new(assets: ResMut<'a, Assets<T>>) -> Self {
Self {
assets,
handle: Handle::weak(HandleId::default::<T>()),
handle: Handle::Weak(AssetId::default()),
}
}

Expand Down Expand Up @@ -1465,7 +1465,7 @@ mod tests {
assert_eq!(cb_mon.last_reported_count, times_completed);
{
let mut event_reader = event_reader_system_state.get_mut(&mut world);
let event = event_reader.iter().next();
let event = event_reader.read().next();
if just_completed {
assert!(event.is_some());
if let Some(event) = event {
Expand Down Expand Up @@ -1877,7 +1877,7 @@ mod tests {

{
let mut event_reader = event_reader_system_state.get_mut(&mut world);
let event = event_reader.iter().next();
let event = event_reader.read().next();
if i == 5 {
assert!(event.is_some());
let event = event.unwrap();
Expand Down
Loading