mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-12-28 18:44:11 +00:00
28 lines
892 B
Rust
28 lines
892 B
Rust
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
|
|
BlenvyPlugin::default(),
|
|
))
|
|
.add_systems(Startup, setup_game)
|
|
.run();
|
|
}
|
|
|
|
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,
|
|
));
|
|
}
|