2024-07-16 09:11:25 +00:00
|
|
|
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(),
|
2024-07-16 09:11:25 +00:00
|
|
|
))
|
|
|
|
.add_systems(Startup, setup_game)
|
|
|
|
.run();
|
|
|
|
}
|
|
|
|
|
2024-07-21 22:29:17 +00:00
|
|
|
fn setup_game(mut commands: Commands) {
|
2024-07-16 09:11:25 +00:00
|
|
|
// 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,
|
|
|
|
));
|
|
|
|
}
|