gizmo-core 0.1.7

A custom ECS and physics engine aimed for realistic simulations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::World;
use crate::entity::Entity;

pub type DespawnHook = Box<dyn FnMut(&mut World, Entity) + Send + Sync>;

pub type AddHook = Box<dyn FnMut(&mut World, Entity) + Send + Sync>;
pub type RemoveHook = Box<dyn FnMut(&mut World, Entity) + Send + Sync>;
pub type SetHook = Box<dyn FnMut(&mut World, Entity) + Send + Sync>;

#[derive(Default)]
pub struct ComponentHooks {
    pub on_add: Vec<AddHook>,
    pub on_remove: Vec<RemoveHook>,
    pub on_set: Vec<SetHook>,
}