Skip to content

Commit

Permalink
spine 4.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jabuwu committed Apr 25, 2024
1 parent c900e96 commit b2dd140
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license-file = "LICENSE"
exclude = ["assets/*"]

[dependencies]
rusty_spine = "0.7"
rusty_spine = { git = "https://github.com/jabuwu/rusty_spine", branch = "spine_4.2" }
bevy = { version = "0.13", default-features = false, features = [
"bevy_render",
"bevy_asset",
Expand Down
3 changes: 2 additions & 1 deletion src/entity_sync.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{fmt::Debug, hash::Hash, marker::PhantomData};

use bevy::prelude::*;
use rusty_spine::Physics;

use crate::{Spine, SpineBone, SpineSystem};

Expand Down Expand Up @@ -176,7 +177,7 @@ pub fn spine_sync_bones<S: SpineSynchronizer>(
}
}
for mut spine in spine_query.iter_mut() {
spine.0.skeleton.update_world_transform();
spine.0.skeleton.update_world_transform(Physics::Update);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use materials::{
use rusty_spine::{
atlas::{AtlasFilter, AtlasWrap},
controller::{SkeletonCombinedRenderable, SkeletonRenderable},
AnimationEvent, Skeleton,
AnimationEvent, Physics, Skeleton,
};
use textures::SpineTextureConfig;

Expand Down Expand Up @@ -833,7 +833,7 @@ fn spine_update_animation(
spine_event_queue: Res<SpineEventQueue>,
) {
for (_, mut spine) in spine_query.iter_mut() {
spine.update(time.delta_seconds());
spine.update(time.delta_seconds(), Physics::Update);
}
{
let mut events = spine_event_queue.0.lock().unwrap();
Expand Down

0 comments on commit b2dd140

Please sign in to comment.