Make stages data-driven

This commit is contained in:
2026-08-27 20:35:03 +02:00
parent fb5775fdcd
commit 46c29857ac
10 changed files with 251 additions and 57 deletions
+5 -2
View File
@@ -6,9 +6,12 @@ use bevy::prelude::*;
pub mod debug;
pub mod line;
pub mod scene;
pub mod manifest;
pub use line::{StagePlaneIntersectResult, StagePoly};
use crate::stage::line::StageCollision;
/// Owns the stage geometry: which scene gets spawned and how it is drawn.
#[derive(Default)]
pub struct StagePlugin;
@@ -22,7 +25,7 @@ impl Plugin for StagePlugin {
}
}
pub fn spawn_stage(commands: &mut Commands, match_root: Entity, visual: Handle<WorldAsset>) {
pub fn spawn_stage(commands: &mut Commands, match_root: Entity, visual: Handle<WorldAsset>, collision: StageCollision) {
commands.entity(match_root).insert(WorldAssetRoot(visual));
scene::spawn_stage_support(commands, match_root);
scene::spawn_stage_support(commands, match_root, collision);
}