Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/bevy_sprite_render/src/sprite_mesh/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy_app::{Plugin, Update};
use bevy_app::{Plugin, PostUpdate};
use bevy_ecs::{
entity::Entity,
query::{Added, Changed, Or},
Expand All @@ -18,15 +18,20 @@ use bevy_sprite::{prelude::SpriteMesh, Anchor};
mod sprite_material;
pub use sprite_material::*;

use crate::MeshMaterial2d;
use crate::{check_entities_needing_specialization, MeshMaterial2d};

pub struct SpriteMeshPlugin;

impl Plugin for SpriteMeshPlugin {
fn build(&self, app: &mut bevy_app::App) {
app.add_plugins(SpriteMaterialPlugin);

app.add_systems(Update, (add_mesh, add_material).chain());
app.add_systems(
PostUpdate,
(add_mesh, add_material)
.chain()
.before(check_entities_needing_specialization::<SpriteMaterial>),
);
}
}

Expand Down