Skip to content
Discussion options

You must be logged in to vote

The easiest way would be to change it's Handle<ColorMaterial> component to be to a different sprite handle. You would generally store your sprite handles in a resource.

E.g.

fn my_change_system(sprites: Res<MySprites>, query: Query<&mut Handle<ColorMaterial>, With<MyEntity>>) {
let mut handle = query.single_mut();
*handle = sprites.surprised.clone();
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gmoller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants