mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
using consistent system naming conventions
This commit is contained in:
parent
dcb292e00a
commit
70b4100132
7 changed files with 10 additions and 10 deletions
|
@ -15,7 +15,7 @@ fn main() {
|
|||
|
||||
fn event_trigger_system() -> Box<dyn Schedulable> {
|
||||
let mut elapsed = 0.0;
|
||||
SystemBuilder::new("EventTrigger")
|
||||
SystemBuilder::new("event_trigger")
|
||||
.read_resource::<Time>()
|
||||
.write_resource::<Event<MyEvent>>()
|
||||
.build(move |_, _, (time, my_event), _| {
|
||||
|
@ -32,7 +32,7 @@ fn event_trigger_system() -> Box<dyn Schedulable> {
|
|||
|
||||
fn event_listener_system(resources: &mut Resources) -> Box<dyn Schedulable> {
|
||||
let mut my_event_handle = resources.get_event_handle::<MyEvent>();
|
||||
SystemBuilder::new("EventListener")
|
||||
SystemBuilder::new("event_listener")
|
||||
.read_resource::<Event<MyEvent>>()
|
||||
.build(move |_, _, my_events, _| {
|
||||
for my_event in my_events.iter(&mut my_event_handle) {
|
||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn build_move_system() -> Box<dyn Schedulable> {
|
||||
SystemBuilder::new("Move")
|
||||
SystemBuilder::new("move")
|
||||
.read_resource::<Time>()
|
||||
.write_resource::<AssetStorage<StandardMaterial>>()
|
||||
.with_query(<(Write<Translation>, Read<Handle<StandardMaterial>>)>::query())
|
||||
|
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
|
||||
// rotates the parent, which will result in the child also rotating
|
||||
fn build_rotator_system() -> Box<dyn Schedulable> {
|
||||
SystemBuilder::new("Rotator")
|
||||
SystemBuilder::new("rotator")
|
||||
.read_resource::<Time>()
|
||||
.with_query(<(Write<Rotator>, Write<Rotation>)>::query())
|
||||
.build(move |_, world, time, rotator_query| {
|
||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn build_move_system() -> Box<dyn Schedulable> {
|
||||
SystemBuilder::new("Move")
|
||||
SystemBuilder::new("move")
|
||||
.read_resource::<Time>()
|
||||
.write_resource::<AssetStorage<StandardMaterial>>()
|
||||
.with_query(<(Write<Translation>, Read<Handle<StandardMaterial>>)>::query())
|
||||
|
|
|
@ -13,7 +13,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn build_move_system() -> Box<dyn Schedulable> {
|
||||
SystemBuilder::new("Move")
|
||||
SystemBuilder::new("move")
|
||||
.read_resource::<Time>()
|
||||
.with_query(<Write<Node>>::query())
|
||||
.build(move |_, world, time, query| {
|
||||
|
|
|
@ -26,7 +26,7 @@ pub fn frame_time_diagnostic_system(
|
|||
max_history_length,
|
||||
));
|
||||
diagnostics.add(Diagnostic::new(FPS, "fps", max_history_length));
|
||||
SystemBuilder::new("FrameTimeDiagnostic")
|
||||
SystemBuilder::new("frame_time_diagnostic")
|
||||
.read_resource::<Time>()
|
||||
.write_resource::<Diagnostics>()
|
||||
.build(move |_, _world, (time, ref mut diagnostics), _queries| {
|
||||
|
@ -57,7 +57,7 @@ pub fn frame_time_diagnostic_system(
|
|||
pub fn print_diagnostics_system(wait: Duration) -> Box<dyn Schedulable> {
|
||||
let mut elasped = 0.0;
|
||||
let wait_seconds = wait.as_secs_f64();
|
||||
SystemBuilder::new("PrintDiagnostics")
|
||||
SystemBuilder::new("print_diagnostics")
|
||||
.read_resource::<Time>()
|
||||
.read_resource::<Diagnostics>()
|
||||
.build(move |_, _world, (time, diagnostics), _queries| {
|
||||
|
@ -81,7 +81,7 @@ pub fn print_diagnostics_system(wait: Duration) -> Box<dyn Schedulable> {
|
|||
pub fn print_diagnostics_debug_system(wait: Duration) -> Box<dyn Schedulable> {
|
||||
let mut elasped = 0.0;
|
||||
let wait_seconds = wait.as_secs_f64();
|
||||
SystemBuilder::new("PrintDiagnostics")
|
||||
SystemBuilder::new("print_diagnostics_debug")
|
||||
.read_resource::<Time>()
|
||||
.read_resource::<Diagnostics>()
|
||||
.build(move |_, _world, (time, diagnostics), _queries| {
|
||||
|
|
|
@ -20,7 +20,7 @@ impl EntityRenderResourceAssignments {
|
|||
|
||||
// TODO: make sure this runs right before rendering
|
||||
pub fn build_entity_render_resource_assignments_system() -> Box<dyn Schedulable> {
|
||||
SystemBuilder::new("EntityRenderResourceAssignments")
|
||||
SystemBuilder::new("entity_render_resource_assignments")
|
||||
.write_resource::<EntityRenderResourceAssignments>()
|
||||
.with_query(<Write<Renderable>>::query().filter(changed::<Renderable>()))
|
||||
.build(|_, world, entity_assignments, query| {
|
||||
|
|
Loading…
Reference in a new issue