Skip to content

Commit

Permalink
Reuse material
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantMoyer committed Sep 7, 2020
1 parent 43ce660 commit cdfe1cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/ecs/parallel_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ fn spawn_system(
) {
commands.spawn(Camera2dComponents::default());
let texture_handle = asset_server.load("assets/branding/icon.png").unwrap();
let material = materials.add(texture_handle.into());
for _ in 0..128 {
commands
.spawn(SpriteComponents {
material: materials.add(texture_handle.into()),
material,
translation: Translation::new(0.0, 0.0, 0.0),
scale: Scale(0.1),
..Default::default()
Expand Down

0 comments on commit cdfe1cd

Please sign in to comment.