derp. needed spatial bundle on parent

main
Elijah Voigt 2 years ago
parent e0cd574a51
commit 47af04bef9

@ -11,32 +11,26 @@
// * (medium) Load default scene when gltf selected // * (medium) Load default scene when gltf selected
// * (medium) Set gltf to active/inactive // * (medium) Set gltf to active/inactive
// * (medium) Play individual animation(s) // * (medium) Play individual animation(s)
// * Only select one at a time.
// * (hard) Better Colorscheme // * (hard) Better Colorscheme
// * (medium) Visual errors for bad GLTFs // * (medium) Visual errors for bad GLTFs
// * (medium) Spawn clicked scene
// * (medium) Play clicked animation // * (medium) Play clicked animation
// * (easy) Play all animations // * (easy) Play all animations
// * (medium) Add fonts similar to Audios based on inspect-fonts
// * (hard) Add Dialogs (requires text box UI, saving, loading).
// //
// Asset types: // Asset types:
// * Audios (done) // * Audios (done)
// * Loop individual // * Loop individual (done)
// * Stop all
// * Gltfs (doing) // * Gltfs (doing)
// * Scenes // * Scenes
// * Animations // * Animations
// * Play/Pause all // * Play/Pause all
// * Fonts // * Fonts (done)
// * Monologues // * Monologues (done)
use bevy::{ use bevy::{
asset::{Asset, Assets}, asset::{Asset, Assets},
asset::{AssetLoader, LoadContext, LoadedAsset}, asset::{AssetLoader, LoadContext, LoadedAsset},
audio::PlaybackMode, audio::PlaybackMode,
gltf::Gltf, gltf::Gltf,
input::{keyboard::KeyboardInput, ButtonState},
prelude::*, prelude::*,
utils::BoxedFuture, utils::BoxedFuture,
}; };
@ -108,7 +102,7 @@ pub struct EditorCamera;
fn initialize_ui(mut commands: Commands) { fn initialize_ui(mut commands: Commands) {
// Empty entity for populating the level being edited // Empty entity for populating the level being edited
commands.spawn((TransformBundle { ..default() }, LevelRoot)); commands.spawn((SpatialBundle { ..default() }, LevelRoot));
commands.spawn(( commands.spawn((
Camera3dBundle { ..default() }, Camera3dBundle { ..default() },
@ -782,11 +776,14 @@ mod scenes {
.iter() .iter()
.filter(|(&interaction, _)| interaction == Interaction::Pressed) .filter(|(&interaction, _)| interaction == Interaction::Pressed)
.for_each(|(_, ui::TargetAsset { handle })| { .for_each(|(_, ui::TargetAsset { handle })| {
info!("Spawning {:?}", handle); info!("Spawning Scene {:?}", handle);
commands commands
.entity(level_root.single()) .entity(level_root.single())
.with_children(|parent| { .with_children(|parent| {
parent.spawn((handle.clone(), TransformBundle { ..default() })); parent.spawn(SceneBundle {
scene: handle.clone(),
..default()
});
}); });
}) })
} }

Loading…
Cancel
Save