1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Component stuff
use ;
use crate::;
pub use ComponentAutoRegister;
/// Implemented for components that are automatically registered to the world.
///
/// You can derive this trait and use the same attributes as the regular [`Component`] derive.
/// In other words, you can still specify storage type and different hooks.
/// `on_add` hook will be called after the registration.
/// Should be called during [`on_add`] hook for every component that should be
/// automatically registered to the world when added.
// macro_rules! wrapper_init {
// ($t:ty, $($c:path),*) => {
// impl<T: bevy_init_in_world::InitInWorld $(+ $c)*> bevy_init_in_world::InitInWorld for $t {
// fn to_init_id() -> std::any::TypeId {
// <T as bevy_init_in_world::InitInWorld>::to_init_id()
// }
// fn init(world: &mut bevy_ecs::world::World) {
// <T as bevy_init_in_world::InitInWorld>::init(world);
// }
// }
// };
// }
// wrapper_init!(Init<'_, '_, T>, SystemParam);
// wrapper_init!(Ref<'_, T>,);
// wrapper_init!(Mut<'_, T>,);
// wrapper_init!(Option<T>,);
// wrapper_init!(PhantomData<T>,);
// wrapper_init!(NonSend<'_, T>,);
// wrapper_init!(NonSendMut<'_, T>,);
// wrapper_init!(Res<'_, T>, Resource);
// wrapper_init!(ResMut<'_, T>, Resource);
// wrapper_init!(EventReader<'_, '_, T>, Event);
// wrapper_init!(EventWriter<'_, T>, Event);
// wrapper_init!(Deferred<'_, T>, SystemBuffer);