|
|
|
|
@ -19,7 +19,9 @@ impl Plugin for EditorTimelinePlugin {
|
|
|
|
|
.add_systems(Update, set_epoch_font)
|
|
|
|
|
.add_systems(Update, load_epoch_font)
|
|
|
|
|
.add_systems(Update, set_epoch_sfx)
|
|
|
|
|
.add_systems(Update, load_epoch_sfx);
|
|
|
|
|
.add_systems(Update, load_epoch_sfx)
|
|
|
|
|
.add_systems(Update, set_epoch_animations)
|
|
|
|
|
.add_systems(Update, load_epoch_animations);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -87,7 +89,7 @@ pub struct EpochAnimations {
|
|
|
|
|
|
|
|
|
|
/// System for adding an epoch to the level's timeline
|
|
|
|
|
/// Triggered when a button with the AddEpoch marker is Active
|
|
|
|
|
pub fn add_timeline_epoch(
|
|
|
|
|
fn add_timeline_epoch(
|
|
|
|
|
root: Query<(Entity, &Children), With<TimelineWidget>>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
) {
|
|
|
|
|
@ -119,7 +121,7 @@ pub fn add_timeline_epoch(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Set the GLTF for the current epoch
|
|
|
|
|
pub fn set_epoch_gltf(
|
|
|
|
|
fn set_epoch_gltf(
|
|
|
|
|
events: Query<&ui::TargetAsset<Gltf>, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -138,13 +140,13 @@ pub fn set_epoch_gltf(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_gltf(events: Query<Option<&EpochGltf>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
fn load_epoch_gltf(events: Query<Option<&EpochGltf>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
events.iter().for_each(|epoch_gltf| {
|
|
|
|
|
warn!("TODO: Load epoch GLTF!");
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_scene(
|
|
|
|
|
fn set_epoch_scene(
|
|
|
|
|
events: Query<&ui::TargetAsset<Scene>, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -161,13 +163,13 @@ pub fn set_epoch_scene(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_scene(events: Query<Option<&EpochScene>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
fn load_epoch_scene(events: Query<Option<&EpochScene>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
events.iter().for_each(|epoch_scene| {
|
|
|
|
|
warn!("TODO: Load epoch Scene!");
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_camera(
|
|
|
|
|
fn set_epoch_camera(
|
|
|
|
|
events: Query<&ui::TargetEntity, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -184,13 +186,13 @@ pub fn set_epoch_camera(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_camera(events: Query<Option<&EpochCamera>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
fn load_epoch_camera(events: Query<Option<&EpochCamera>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
events.iter().for_each(|epoch_camera| {
|
|
|
|
|
warn!("TODO: Load epoch Camera");
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_music(
|
|
|
|
|
fn set_epoch_music(
|
|
|
|
|
events: Query<&ui::TargetAsset<AudioSource>, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -207,13 +209,13 @@ pub fn set_epoch_music(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_music(events: Query<Option<&EpochMusic>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
fn load_epoch_music(events: Query<Option<&EpochMusic>, (Added<ui::Active>, With<EpochId>)>) {
|
|
|
|
|
events.iter().for_each(|epoch_music| {
|
|
|
|
|
warn!("TODO: Load epoch music!");
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_monologue(
|
|
|
|
|
fn set_epoch_monologue(
|
|
|
|
|
events: Query<&ui::TargetAsset<Monologue>, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -230,7 +232,7 @@ pub fn set_epoch_monologue(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_monologue(
|
|
|
|
|
fn load_epoch_monologue(
|
|
|
|
|
events: Query<Option<&EpochMonologue>, (Added<ui::Active>, With<EpochId>)>,
|
|
|
|
|
) {
|
|
|
|
|
events.iter().for_each(|epoch_monologue| {
|
|
|
|
|
@ -243,7 +245,7 @@ pub fn load_epoch_monologue(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_font(
|
|
|
|
|
fn set_epoch_font(
|
|
|
|
|
events: Query<&ui::TargetAsset<Font>, Added<ui::Active>>,
|
|
|
|
|
active_epoch: Query<Entity, (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -260,7 +262,7 @@ pub fn set_epoch_font(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_font(
|
|
|
|
|
fn load_epoch_font(
|
|
|
|
|
events: Query<Option<&EpochFont>, (Added<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut font_info: ResMut<FontInfo>,
|
|
|
|
|
) {
|
|
|
|
|
@ -269,7 +271,7 @@ pub fn load_epoch_font(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_sfx(
|
|
|
|
|
fn set_epoch_sfx(
|
|
|
|
|
events: Query<&ui::TargetAsset<AudioSource>, Added<ui::Active>>,
|
|
|
|
|
mut active_epoch: Query<(Entity, Option<&mut EpochSfx>), (With<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut commands: Commands,
|
|
|
|
|
@ -291,7 +293,7 @@ pub fn set_epoch_sfx(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_sfx(
|
|
|
|
|
fn load_epoch_sfx(
|
|
|
|
|
added: Query<Entity, (Added<ui::Active>, With<EpochId>)>,
|
|
|
|
|
mut removed: RemovedComponents<ui::Active>,
|
|
|
|
|
epoch_sfx: Query<&EpochSfx>,
|
|
|
|
|
@ -313,7 +315,7 @@ pub fn load_epoch_sfx(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_epoch_animations(
|
|
|
|
|
fn set_epoch_animations(
|
|
|
|
|
events: Query<&ui::TargetAsset<AnimationClip>, Added<ui::Active>>,
|
|
|
|
|
mut active_epoch: Query<
|
|
|
|
|
(Entity, Option<&mut EpochAnimations>),
|
|
|
|
|
@ -339,7 +341,7 @@ pub fn set_epoch_animations(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn load_epoch_animations(
|
|
|
|
|
fn load_epoch_animations(
|
|
|
|
|
events: Query<Option<&EpochAnimations>, (Added<ui::Active>, With<EpochId>)>,
|
|
|
|
|
) {
|
|
|
|
|
events.iter().for_each(|epoch_animations| {
|
|
|
|
|
|