Trait bevy_ecs::system::SystemParam [−][src]
pub trait SystemParam: Sized {
type Fetch: for<'w, 's> SystemParamFetch<'w, 's>;
}
Expand description
A parameter that can be used in a System
.
Derive
This trait can be derived with the super::SystemParam
macro. The only requirement
is that every struct field must also implement SystemParam
.
use std::marker::PhantomData;
use bevy_ecs::system::SystemParam;
#[derive(SystemParam)]
struct MyParam<'w, 's> {
foo: Res<'w, usize>,
#[system_param(ignore)]
marker: PhantomData<&'s usize>,
}
fn my_system(param: MyParam) {
// Access the resource through `param.foo`
}