gltf prefabs

This commit is contained in:
2024-11-24 00:05:07 -05:00
parent 953650e394
commit 358b88e7fe
8 changed files with 150 additions and 26 deletions

View File

@@ -0,0 +1,20 @@
use bevy::{
ecs::system::EntityCommands, math::{Quat, Vec3}, prelude::*
};
use serde::{Deserialize, Serialize};
use crate::prefab_defination::AnimationComponent;
#[derive(Serialize, Deserialize, Debug)]
pub struct ComponentDefination {
pub path: String,
pub animations: Vec<AnimationComponent>,
}
impl ComponentDefination {
pub fn apply(&self, commands: &mut EntityCommands){
for c in &self.animations {
c.apply(commands);
}
}
}