Skip to content
Snippets Groups Projects
Verified Commit 6935fdc5 authored by Louis's avatar Louis :fire:
Browse files

Update ecs_tilemap dep, re-enable ecs_tilemap

parent cb727060
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. ...@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- Required bevy version is now 0.10
- Optional bevy_ecs_tilemap version is now 0.10
## [0.3.1] ## [0.3.1]
### Fixed ### Fixed
......
[package] [package]
name = "micro_banimate" name = "micro_banimate"
version = "0.5.0-beta.1" version = "0.5.0-beta.2"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Easily manage complex Bevy 2D sprite animations" description = "Easily manage complex Bevy 2D sprite animations"
...@@ -15,7 +15,7 @@ json_loader = ["serde", "dep:serde_json"] ...@@ -15,7 +15,7 @@ json_loader = ["serde", "dep:serde_json"]
toml_loader = ["serde", "dep:toml"] toml_loader = ["serde", "dep:toml"]
serde = ["dep:serde"] serde = ["dep:serde"]
#ecs_tilemap = ["dep:bevy_ecs_tilemap"] ecs_tilemap = ["dep:bevy_ecs_tilemap"]
[dependencies] [dependencies]
anyhow = "^1.0.65" anyhow = "^1.0.65"
...@@ -24,4 +24,4 @@ serde_json = { version = "^1.0.85", optional = true } ...@@ -24,4 +24,4 @@ serde_json = { version = "^1.0.85", optional = true }
toml = { version = "^0.5.9", optional = true } toml = { version = "^0.5.9", optional = true }
bevy = { version = "^0.10.0", default-features = false, features = ["bevy_asset", "bevy_sprite"] } bevy = { version = "^0.10.0", default-features = false, features = ["bevy_asset", "bevy_sprite"] }
#bevy_ecs_tilemap = { version = "^0.9.0", optional = true } bevy_ecs_tilemap = { version = "0.10.0", optional = true }
...@@ -122,6 +122,6 @@ frame_time = 100 ...@@ -122,6 +122,6 @@ frame_time = 100
| banimate version | bevy version | tilemap version | | banimate version | bevy version | tilemap version |
|---------------------|--------------|-----------------| |---------------------|--------------|-----------------|
| 0.5.x | 0.10 | -- | | 0.5.x | 0.10 | 0.10 |
| 0.2.x, 0.3.x, 0.4.x | 0.9 | 0.9 | | 0.2.x, 0.3.x, 0.4.x | 0.9 | 0.9 |
| 0.1.x | 0.8 | 0.8 | | 0.1.x | 0.8 | 0.8 |
...@@ -52,7 +52,7 @@ pub struct AnimationQuery<'w, 's> { ...@@ -52,7 +52,7 @@ pub struct AnimationQuery<'w, 's> {
direction: Query<'w, 's, &'static mut Directionality>, direction: Query<'w, 's, &'static mut Directionality>,
action_animation: Query<'w, 's, &'static mut AnimationOverride>, action_animation: Query<'w, 's, &'static mut AnimationOverride>,
tile_sprite: Query<'w, 's, &'static mut TextureAtlasSprite>, tile_sprite: Query<'w, 's, &'static mut TextureAtlasSprite>,
paused: Query<'w, 's, Entity, With<AnimationPaused>>, paused: Query<'w, 's, (), With<AnimationPaused>>,
events: EventWriter<'w, AnimationCompleted>, events: EventWriter<'w, AnimationCompleted>,
} }
...@@ -408,8 +408,6 @@ impl<'w, 's> AnimationQuery<'w, 's> { ...@@ -408,8 +408,6 @@ impl<'w, 's> AnimationQuery<'w, 's> {
let directed = format!("{}_{}", &fallback, direction); let directed = format!("{}_{}", &fallback, direction);
// log::info!("Directed - {}", directed);
if set.contains_key(&directed) { if set.contains_key(&directed) {
status.start_or_continue(directed); status.start_or_continue(directed);
} else { } else {
......
...@@ -52,42 +52,42 @@ pub fn sync_parent_animations(mut query: AnimationQuery) { ...@@ -52,42 +52,42 @@ pub fn sync_parent_animations(mut query: AnimationQuery) {
query.sync_parent_animations(); query.sync_parent_animations();
} }
// #[cfg(feature = "ecs_tilemap")] #[cfg(feature = "ecs_tilemap")]
// pub fn tick_simple_tilemap_animation( pub fn tick_simple_tilemap_animation(
// time: Res<Time>, time: Res<Time>,
// mut query: Query< mut query: Query<
// ( (
// &SimpleLoopedAnimation, &SimpleLoopedAnimation,
// &mut SimpleLoopedAnimationStatus, &mut SimpleLoopedAnimationStatus,
// &mut bevy_ecs_tilemap::tiles::TileTextureIndex, &mut bevy_ecs_tilemap::tiles::TileTextureIndex,
// ), ),
// With<HasSimpleAnimations>, With<HasSimpleAnimations>,
// >, >,
// ) { ) {
// let seconds = time.delta_seconds(); let seconds = time.delta_seconds();
// for (animation, mut state, mut tile) in &mut query { for (animation, mut state, mut tile) in &mut query {
// state.frame_time += seconds; state.frame_time += seconds;
// while state.frame_time >= animation.frame_secs { while state.frame_time >= animation.frame_secs {
// state.frame_time -= animation.frame_secs; state.frame_time -= animation.frame_secs;
// state.active_step += 1; state.active_step += 1;
// if state.active_step >= animation.frames.len() { if state.active_step >= animation.frames.len() {
// state.active_step = 0; state.active_step = 0;
// } }
// } }
//
// *tile = *tile =
// bevy_ecs_tilemap::tiles::TileTextureIndex(animation.frames[state.active_step] as u32); bevy_ecs_tilemap::tiles::TileTextureIndex(animation.frames[state.active_step] as u32);
// } }
// } }
pub struct AnimationSystemsPlugin; pub struct AnimationSystemsPlugin;
impl Plugin for AnimationSystemsPlugin { impl Plugin for AnimationSystemsPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
app.configure_sets(( app.configure_sets((
CoreSet::PostUpdate,
AnimationSystems::TickAnimations, AnimationSystems::TickAnimations,
AnimationSystems::SyncAnimations, AnimationSystems::SyncAnimations,
CoreSet::PostUpdate,
)); ));
app.add_event::<AnimationCompleted>() app.add_event::<AnimationCompleted>()
...@@ -97,9 +97,11 @@ impl Plugin for AnimationSystemsPlugin { ...@@ -97,9 +97,11 @@ impl Plugin for AnimationSystemsPlugin {
) )
.add_system(sync_parent_animations.in_base_set(AnimationSystems::SyncAnimations)); .add_system(sync_parent_animations.in_base_set(AnimationSystems::SyncAnimations));
// #[cfg(feature = "ecs_tilemap")] #[cfg(feature = "ecs_tilemap")]
// { {
// app.add_system(tick_simple_tilemap_animation.in_set(AnimationSystems::TickAnimations)); app.add_system(
// } tick_simple_tilemap_animation.in_base_set(AnimationSystems::TickAnimations),
);
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment