picking + entity names
This commit is contained in:
@@ -19,6 +19,7 @@ impl Bundle for SpotlightBundle
|
||||
let transform = Transform::from_matrix(self.light_data.transform);
|
||||
world.transforms.insert(entity, transform);
|
||||
world.spotlights.insert(entity, self.light_data.component);
|
||||
world.names.insert(entity, "Spotlight".to_string());
|
||||
if let Some(tag) = self.light_data.tag
|
||||
{
|
||||
if tag == "lighthouse"
|
||||
@@ -34,12 +35,13 @@ impl Bundle for SpotlightBundle
|
||||
|
||||
pub fn spawn_spotlights(world: &mut World, spotlights: Vec<LightData>)
|
||||
{
|
||||
for light_data in spotlights
|
||||
for (index, light_data) in spotlights.into_iter().enumerate()
|
||||
{
|
||||
let entity = world.spawn();
|
||||
let transform = Transform::from_matrix(light_data.transform);
|
||||
world.transforms.insert(entity, transform);
|
||||
world.spotlights.insert(entity, light_data.component);
|
||||
world.names.insert(entity, format!("Spotlight_{}", index));
|
||||
if let Some(tag) = light_data.tag
|
||||
{
|
||||
if tag == "lighthouse"
|
||||
|
||||
Reference in New Issue
Block a user