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

Update to bevy 0.8 #34

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ bevy_ui = ["bevy/bevy_ui", "bevy/bevy_text", "bevy/bevy_render"]

[dependencies]
interpolation = "0.2"
bevy = { version = "0.7", default-features = false }
bevy = { version = "0.8", default-features = false, features = ["bevy_asset"] }
Copy link
Contributor

@SUPERCILEX SUPERCILEX Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bevy_asset should have its own separate feature so users aren't forced to enable it. Probs not worth blocking the upgrade for this so created #35.


[dev-dependencies]
bevy-inspector-egui = "0.10"
# [dev-dependencies]
# bevy-inspector-egui = "0.11"

[[example]]
name = "menu"
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.3", features = ["html_reports"] }
bevy_tweening = { path = "../" }

[dependencies.bevy]
version = "0.6"
version = "0.8"
default-features = false
features = [ "render" ]

Expand Down
6 changes: 3 additions & 3 deletions src/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ impl Lens<Transform> for TransformScaleLens {
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct UiPositionLens {
/// Start position.
pub start: Rect<Val>,
pub start: UiRect<Val>,
/// End position.
pub end: Rect<Val>,
pub end: UiRect<Val>,
}

#[cfg(feature = "bevy_ui")]
Expand All @@ -312,7 +312,7 @@ fn lerp_val(start: &Val, end: &Val, ratio: f32) -> Val {
#[cfg(feature = "bevy_ui")]
impl Lens<Style> for UiPositionLens {
fn lerp(&mut self, target: &mut Style, ratio: f32) {
target.position = Rect {
target.position = UiRect {
left: lerp_val(&self.start.left, &self.end.left, ratio),
right: lerp_val(&self.start.right, &self.end.right, ratio),
top: lerp_val(&self.start.top, &self.end.top, ratio),
Expand Down
5 changes: 3 additions & 2 deletions src/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use bevy::{asset::Asset, ecs::component::Component, prelude::*};
use bevy::asset::Asset;
use bevy::{ecs::component::Component, prelude::*};

use crate::{Animator, AnimatorState, AssetAnimator, TweenCompleted};

Expand Down Expand Up @@ -86,7 +87,7 @@ pub fn asset_animator_system<T: Asset>(
) {
for (entity, ref mut animator) in query.iter_mut() {
if animator.state != AnimatorState::Paused {
if let Some(target) = assets.get_mut(animator.handle()) {
if let Some(target) = assets.get_mut(&animator.handle()) {
animator.tick(time.delta(), target, entity, &mut event_writer);
}
}
Expand Down