mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2025-01-01 04:14:11 +00:00
33 lines
901 B
Rust
33 lines
901 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,
|
||
|
));
|
||
|
}
|