pub fn add_multiple(
        &mut self,
        entities: Vec<Entity>,
        sprite: &Sprite,
        texture: TextureHandle,
        texture_size: (f32, f32),
    ) -> Result<()> {
        let len = entities.len();
        if len != 0 {
            let (mesh, material) = self.build_mesh_and_material(sprite, texture, texture_size);
            for entity in 0..len - 1 {
                self.meshes.insert(entities[entity], mesh.clone())?;
                self.materials.insert(entities[entity], material.clone())?;
            }
            self.meshes.insert(entities[len - 1], mesh)?;
            self.materials.insert(entities[len - 1], material)?;
        }
        Ok(())
    }
/// Adds the same mesh and material to multiple entities corresponding to the sprite and texture given.
Adds the same mesh and material to multiple entities corresponding to the sprite and texture given.
Adds the same mesh and material to multiple entities corresponding to the sprite and texture given .
pub fn add_multiple(
        &mut self,
        entities: Vec<Entity>,
        sprite: &Sprite,
        texture: TextureHandle,
        texture_size: (f32, f32),
    ) -> Result<()> {
        let len = entities.len();
        if len != 0 {
            let (mesh, material) = self.build_mesh_and_material(sprite, texture, texture_size);
            for entity in 0..len - 1 {
                self.meshes.insert(entities[entity], mesh.clone())?;
                self.materials.insert(entities[entity], material.clone())?;
            }
            self.meshes.insert(entities[len - 1], mesh)?;
            self.materials.insert(entities[len - 1], material)?;
        }
        Ok(())
    }
pub fn add_multiple ( & mut self , entities : Vec < Entity > , sprite : & Sprite , texture : TextureHandle , texture_size : ( f32 , f32 ) , ) -> Result < ( ) > { let len = entities . len ( ) ; if len != 0 { let ( mesh , material ) = self . build_mesh_and_material ( sprite , texture , texture_size ) ; for entity in 0 .. len - 1 { self . meshes . insert ( entities [ entity ] , mesh . clone ( ) ) ? ; self . materials . insert ( entities [ entity ] , material . clone ( ) ) ? ; } self . meshes . insert ( entities [ len - 1 ] , mesh ) ? ; self . materials . insert ( entities [ len - 1 ] , material ) ? ; } Ok ( ( ) ) }
Adds the same mesh and material to multiple entities corresponding to the sprite and texture given.
Adds the same mesh and material to multiple entities corresponding to the sprite and texture given .
&mut self
entities
Vec<Entity>
sprite
&Sprite
texture
TextureHandle
texture_size
(f32, f32)
&mut self
entities
Vec<Entity>
sprite
&Sprite
texture
TextureHandle
texture_size
(f32, f32)