Blender_bevy_components_wor.../examples/components/src/main.rs

28 lines
892 B
Rust
Raw Normal View History

use bevy::prelude::*;
use blenvy::{BlenvyPlugin, BlueprintInfo, GameWorldTag, HideUntilReady, SpawnBlueprint};
mod component_examples;
use component_examples::*;
fn main() {
App::new()
.add_plugins((
DefaultPlugins.set(AssetPlugin::default()),
// our custom plugins
ComponentsExamplesPlugin, // Showcases different type of components /structs
2024-07-21 22:29:17 +00:00
BlenvyPlugin::default(),
))
.add_systems(Startup, setup_game)
.run();
}
2024-07-21 22:29:17 +00:00
fn setup_game(mut commands: Commands) {
// here we actually spawn our game world/level
commands.spawn((
BlueprintInfo::from_path("levels/World.glb"), // all we need is a Blueprint info...
SpawnBlueprint, // and spawnblueprint to tell blenvy to spawn the blueprint now
HideUntilReady, // only reveal the level once it is ready
GameWorldTag,
));
}