Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bevy Sprite Animations
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Sprite Animations
Commits
6c87a1e4
Verified
Commit
6c87a1e4
authored
2 years ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Handle directional overrides correctly
parent
db0f9c79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
src/query.rs
+13
-1
13 additions, 1 deletion
src/query.rs
with
14 additions
and
2 deletions
Cargo.toml
+
1
−
1
View file @
6c87a1e4
[package]
name
=
"micro_banimate"
version
=
"0.
2.1
"
version
=
"0.
3.0
"
edition
=
"2021"
license
=
"Apache-2.0"
description
=
"Easily manage complex Bevy 2D sprite animations"
...
...
This diff is collapsed.
Click to expand it.
src/query.rs
+
13
−
1
View file @
6c87a1e4
...
...
@@ -265,10 +265,22 @@ impl<'w, 's> AnimationQuery<'w, 's> {
};
if
let
Ok
(
mut
status
)
=
self
.action_animation
.get_mut
(
entity
)
{
let
current
=
match
sheet
.get
(
&
status
.name
)
{
let
(
a
,
b
)
=
match
self
.direction
.get
(
entity
)
{
Ok
(
dir
)
=>
{
let
directional
=
format!
(
"{}_{}"
,
status
.name
,
dir
);
(
directional
,
status
.name
.clone
())
}
Err
(
_
)
=>
(
status
.name
.clone
(),
status
.name
.clone
()),
};
let
current
=
match
sheet
.get
(
&
a
)
.or_else
(||
sheet
.get
(
&
b
))
{
Some
(
set
)
=>
set
,
None
=>
{
self
.commands
.entity
(
entity
)
.remove
::
<
AnimationOverride
>
();
self
.events
.send
(
AnimationCompleted
{
entity
,
user_data
:
status
.user_data
,
});
continue
;
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment