mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-28 08:58:07 +00:00
save and load keyframe data (#97)
This commit is contained in:
@@ -15,7 +15,7 @@ use bevy_tweening::{
|
|||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use space_editor::space_prefab::editor_registry::EditorRegistryExt;
|
use space_editor::{prelude::PrefabMarker, space_prefab::editor_registry::EditorRegistryExt};
|
||||||
|
|
||||||
use crate::interaction::{MarkedForDeletion, Selectable};
|
use crate::interaction::{MarkedForDeletion, Selectable};
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ impl Plugin for TimelinePlugin {
|
|||||||
.editor_registry::<Keyframe>()
|
.editor_registry::<Keyframe>()
|
||||||
.register_type::<KeyframeOrder>()
|
.register_type::<KeyframeOrder>()
|
||||||
.editor_registry::<KeyframeOrder>()
|
.editor_registry::<KeyframeOrder>()
|
||||||
|
.register_type::<EaseType>()
|
||||||
.add_event::<TimelineInteractionEvent>()
|
.add_event::<TimelineInteractionEvent>()
|
||||||
.add_event::<KeyframeInteractionEvent>();
|
.add_event::<KeyframeInteractionEvent>();
|
||||||
|
|
||||||
@@ -258,6 +259,7 @@ fn process_keyframe_events(
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
|
PrefabMarker,
|
||||||
SpatialBundle {
|
SpatialBundle {
|
||||||
transform: *transform,
|
transform: *transform,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ impl RemoteAssetReader {
|
|||||||
const API_BASE_URL: &'static str = "https://api.fakeyou.com/v1/media_files/file";
|
const API_BASE_URL: &'static str = "https://api.fakeyou.com/v1/media_files/file";
|
||||||
const BUCKET_BASE_URL: &'static str = "https://storage.googleapis.com/vocodes-public";
|
const BUCKET_BASE_URL: &'static str = "https://storage.googleapis.com/vocodes-public";
|
||||||
|
|
||||||
async fn load<'a>(
|
async fn load<'a>(&'a self, path: &'a Path) -> Result<Box<Reader<'a>>, AssetReaderError> {
|
||||||
&'a self,
|
|
||||||
path: &'a Path,
|
|
||||||
) -> Result<Box<Reader<'a>>, AssetReaderError> {
|
|
||||||
let token = path
|
let token = path
|
||||||
.ext_file_prefix()
|
.ext_file_prefix()
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
@@ -88,9 +85,7 @@ impl AssetReader for RemoteAssetReader {
|
|||||||
&'a self,
|
&'a self,
|
||||||
path: &'a Path,
|
path: &'a Path,
|
||||||
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
|
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
|
||||||
let unboxed = async move {
|
let unboxed = async move { self.load(path).await };
|
||||||
self.load(path).await
|
|
||||||
};
|
|
||||||
if cfg!(not(feature = "wasm")) {
|
if cfg!(not(feature = "wasm")) {
|
||||||
info!("wasm mode not detected");
|
info!("wasm mode not detected");
|
||||||
// NB: Headless mode (server rendering) is running without a Tokio runtime.
|
// NB: Headless mode (server rendering) is running without a Tokio runtime.
|
||||||
|
|||||||
Reference in New Issue
Block a user