gltf prefabs
This commit is contained in:
20
game/shared/src/component_defination.rs
Normal file
20
game/shared/src/component_defination.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user