bevy_ecs/world/
component_constants.rs1use super::*;
4use crate::{self as bevy_ecs};
5#[cfg(feature = "bevy_reflect")]
6use bevy_reflect::Reflect;
7
8pub const ON_ADD: ComponentId = ComponentId::new(0);
10pub const ON_INSERT: ComponentId = ComponentId::new(1);
12pub const ON_REPLACE: ComponentId = ComponentId::new(2);
14pub const ON_REMOVE: ComponentId = ComponentId::new(3);
16
17#[derive(Event, Debug)]
20#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
21#[cfg_attr(feature = "bevy_reflect", reflect(Debug))]
22pub struct OnAdd;
23
24#[derive(Event, Debug)]
27#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
28#[cfg_attr(feature = "bevy_reflect", reflect(Debug))]
29pub struct OnInsert;
30
31#[derive(Event, Debug)]
34#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
35#[cfg_attr(feature = "bevy_reflect", reflect(Debug))]
36pub struct OnReplace;
37
38#[derive(Event, Debug)]
41#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
42#[cfg_attr(feature = "bevy_reflect", reflect(Debug))]
43pub struct OnRemove;