picking + entity names

This commit is contained in:
Jonas H
2026-03-05 15:05:19 +01:00
parent 5e5c6a47e7
commit bab54b6f21
9 changed files with 400 additions and 50 deletions

View File

@@ -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"