File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -674,7 +674,17 @@ impl ComponentTicks {
674
674
}
675
675
}
676
676
677
- /// Initialize and fetch a component id for a generic type.
677
+ /// Initialize and fetch a [`ComponentId`] for a specific type.
678
+ ///
679
+ /// # Example
680
+ /// ```rust
681
+ /// # use bevy_ecs::{system::Local, component::{Component, ComponentIdFor}};
682
+ /// #[derive(Component)]
683
+ /// struct Player;
684
+ /// fn my_system(my_component_id: Local<ComponentIdFor<Player>>) {
685
+ /// // ...
686
+ /// }
687
+ /// ```
678
688
pub struct ComponentIdFor < T : Component > {
679
689
component_id : ComponentId ,
680
690
phantom : PhantomData < T > ,
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ impl RemovedComponentEvents {
74
74
}
75
75
}
76
76
77
- #[ derive( SystemParam ) ]
78
77
/// A [`SystemParam`] that grants access to the entities that had their `T` [`Component`] removed.
79
78
///
80
79
/// Note that this does not allow you to see which data existed before removal.
@@ -106,6 +105,7 @@ impl RemovedComponentEvents {
106
105
/// }
107
106
/// # bevy_ecs::system::assert_is_system(react_on_removal);
108
107
/// ```
108
+ #[ derive( SystemParam ) ]
109
109
pub struct RemovedComponents < ' w , ' s , T : Component > {
110
110
component_id : Local < ' s , ComponentIdFor < T > > ,
111
111
reader : Local < ' s , RemovedComponentReader < T > > ,
You can’t perform that action at this time.
0 commit comments