Documentation improvement system_param.rs (#20157)
# Objective Improvement of the documentation for SystemParam derive section so that it mentions how to use a Query<&SomeComponent> as a SystemParam for a struct that should have #[derive(SystemParam)]. ## Solution Added the documentation --- ## Showcase the previous documentation ```rust Query<'w, 's, Entity>, Res<'w, SomeResource>, ResMut<'w, SomeOtherResource>, Local<'s, u8>, Commands<'w, 's>, EventReader<'w, 's, SomeEvent>, EventWriter<'w, SomeEvent> ``` the new documentation ```rust Query<'w, 's, Entity>, Query<'w, 's, &'static SomeComponent>, <================== the new thing Res<'w, SomeResource>, ResMut<'w, SomeOtherResource>, Local<'s, u8>, Commands<'w, 's>, EventReader<'w, 's, SomeEvent>, EventWriter<'w, SomeEvent> ```
This commit is contained in:
parent
e7c14bd06b
commit
2bcd85421e
@ -55,6 +55,8 @@ use variadics_please::{all_tuples, all_tuples_enumerated};
|
||||
///
|
||||
/// ```
|
||||
/// # use bevy_ecs::prelude::*;
|
||||
/// # #[derive(Component)]
|
||||
/// # struct SomeComponent;
|
||||
/// # #[derive(Resource)]
|
||||
/// # struct SomeResource;
|
||||
/// # #[derive(BufferedEvent)]
|
||||
@ -66,6 +68,8 @@ use variadics_please::{all_tuples, all_tuples_enumerated};
|
||||
/// # struct ParamsExample<'w, 's> {
|
||||
/// # query:
|
||||
/// Query<'w, 's, Entity>,
|
||||
/// # query2:
|
||||
/// Query<'w, 's, &'static SomeComponent>,
|
||||
/// # res:
|
||||
/// Res<'w, SomeResource>,
|
||||
/// # res_mut:
|
||||
|
Loading…
Reference in New Issue
Block a user