From 47af04bef92f4479c1535e54da547fbe37c08a76 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Mon, 28 Aug 2023 08:25:25 -0700 Subject: [PATCH] derp. needed spatial bundle on parent --- bin/editor.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/bin/editor.rs b/bin/editor.rs index c8f5992..14958b1 100644 --- a/bin/editor.rs +++ b/bin/editor.rs @@ -11,32 +11,26 @@ // * (medium) Load default scene when gltf selected // * (medium) Set gltf to active/inactive // * (medium) Play individual animation(s) -// * Only select one at a time. // * (hard) Better Colorscheme // * (medium) Visual errors for bad GLTFs -// * (medium) Spawn clicked scene // * (medium) Play clicked animation // * (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: // * Audios (done) -// * Loop individual -// * Stop all +// * Loop individual (done) // * Gltfs (doing) // * Scenes // * Animations // * Play/Pause all -// * Fonts -// * Monologues +// * Fonts (done) +// * Monologues (done) use bevy::{ asset::{Asset, Assets}, asset::{AssetLoader, LoadContext, LoadedAsset}, audio::PlaybackMode, gltf::Gltf, - input::{keyboard::KeyboardInput, ButtonState}, prelude::*, utils::BoxedFuture, }; @@ -108,7 +102,7 @@ pub struct EditorCamera; fn initialize_ui(mut commands: Commands) { // Empty entity for populating the level being edited - commands.spawn((TransformBundle { ..default() }, LevelRoot)); + commands.spawn((SpatialBundle { ..default() }, LevelRoot)); commands.spawn(( Camera3dBundle { ..default() }, @@ -782,11 +776,14 @@ mod scenes { .iter() .filter(|(&interaction, _)| interaction == Interaction::Pressed) .for_each(|(_, ui::TargetAsset { handle })| { - info!("Spawning {:?}", handle); + info!("Spawning Scene {:?}", handle); commands .entity(level_root.single()) .with_children(|parent| { - parent.spawn((handle.clone(), TransformBundle { ..default() })); + parent.spawn(SceneBundle { + scene: handle.clone(), + ..default() + }); }); }) }