Make the baked animation system drive the character animations

This commit is contained in:
2026-09-01 21:07:53 +02:00
parent 89eeb6a868
commit b2da4a737d
11 changed files with 345 additions and 273 deletions
+13 -6
View File
@@ -1,7 +1,15 @@
use std::io;
use bevy::{asset::{AssetLoader, AssetPath, AsyncReadExt, AsyncWriteExt, LoadContext, io::{Reader, Writer}, processor::LoadTransformAndSave, saver::{AssetSaver, SavedAsset}, transformer::{AssetTransformer, TransformedAsset}}, prelude::*};
use bevy::{
asset::{
AssetLoader, AssetPath, AsyncReadExt, AsyncWriteExt, LoadContext,
io::{Reader, Writer},
processor::LoadTransformAndSave,
saver::{AssetSaver, SavedAsset},
transformer::{AssetTransformer, TransformedAsset},
},
prelude::*,
};
use crate::scripting::{FighterAttackScript, move_compiler};
@@ -26,7 +34,7 @@ impl AssetLoader for FighterAttackScriptSourceLoader {
reader.read_to_string(&mut contents).await?;
Ok(FighterAttackScriptContents(contents))
}
fn extensions(&self) -> &[&str] {
&["attack.rhai"]
}
@@ -41,7 +49,7 @@ impl AssetTransformer for FighterAttackScriptTransformer {
type Settings = ();
type Error = String;
async fn transform<'a>(
async fn transform<'a>(
&'a self,
source: TransformedAsset<Self::AssetInput>,
_: &'a Self::Settings,
@@ -51,7 +59,6 @@ impl AssetTransformer for FighterAttackScriptTransformer {
}
}
#[derive(Default, TypePath)]
struct FighterAttackScriptLoader;
@@ -118,4 +125,4 @@ impl Plugin for FighterScriptImportPlugin {
))
.set_default_asset_processor::<FighterAttackScriptProcessor>("attack.rhai");
}
}
}
+4 -4
View File
@@ -1,14 +1,14 @@
use bevy::{prelude::*};
use bevy::prelude::*;
use serde::{Deserialize, Serialize};
use crate::{fighter::attack::AttackHitbox, math::int::FGi32};
pub mod move_compiler;
pub mod importer;
pub mod move_compiler;
pub enum MoveAngleKind {
Normal(FGi32),
Sakurai
Sakurai,
}
#[derive(Asset, Reflect, Serialize, Deserialize)]
@@ -16,4 +16,4 @@ pub struct FighterAttackScript {
pub hitboxes: Vec<AttackHitbox>,
pub iasa_frame: u32,
pub wont_autocancel_window: (u32, u32),
}
}