mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Make Material2d pipeline systems public (#8642)
# Objective Make `Material2dPipeline` reusable. This was already done for PBR materials in #7548. ## Solution Expose `extract_materials_2d`, `prepare_materials_2d` and `ExtractedMaterials2d`. --- ## Changelog - bevy_sprite: Make `prepare_materials_2d`, `extract_materials_2d` and `ExtractedMaterials2d` public.
This commit is contained in:
parent
f0b1e1d32b
commit
335afbf77a
1 changed files with 3 additions and 3 deletions
|
@ -432,7 +432,7 @@ pub struct PreparedMaterial2d<T: Material2d> {
|
|||
}
|
||||
|
||||
#[derive(Resource)]
|
||||
struct ExtractedMaterials2d<M: Material2d> {
|
||||
pub struct ExtractedMaterials2d<M: Material2d> {
|
||||
extracted: Vec<(Handle<M>, M)>,
|
||||
removed: Vec<Handle<M>>,
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ impl<T: Material2d> Default for RenderMaterials2d<T> {
|
|||
|
||||
/// This system extracts all created or modified assets of the corresponding [`Material2d`] type
|
||||
/// into the "render world".
|
||||
fn extract_materials_2d<M: Material2d>(
|
||||
pub fn extract_materials_2d<M: Material2d>(
|
||||
mut commands: Commands,
|
||||
mut events: Extract<EventReader<AssetEvent<M>>>,
|
||||
assets: Extract<Res<Assets<M>>>,
|
||||
|
@ -505,7 +505,7 @@ impl<M: Material2d> Default for PrepareNextFrameMaterials<M> {
|
|||
|
||||
/// This system prepares all assets of the corresponding [`Material2d`] type
|
||||
/// which where extracted this frame for the GPU.
|
||||
fn prepare_materials_2d<M: Material2d>(
|
||||
pub fn prepare_materials_2d<M: Material2d>(
|
||||
mut prepare_next_frame: Local<PrepareNextFrameMaterials<M>>,
|
||||
mut extracted_assets: ResMut<ExtractedMaterials2d<M>>,
|
||||
mut render_materials: ResMut<RenderMaterials2d<M>>,
|
||||
|
|
Loading…
Reference in a new issue