Skip to content

Commit

Permalink
resolve conflicts and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Nov 8, 2020
1 parent 039933f commit 1c83a03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
5 changes: 2 additions & 3 deletions crates/bevy_ecs/hecs/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use proc_macro_crate::crate_name;
use quote::quote;
use syn::{parse_macro_input, DeriveInput, Error, Ident, Index, Lifetime, Path, Result};
use syn::{
parse::ParseStream, parse_macro_input, Data, DataStruct, DeriveInput, Field, Fields, Ident,
Index, Lifetime, Path,
parse::ParseStream, parse_macro_input, Data, DataStruct, DeriveInput, Error, Field, Fields,
Ident, Index, Lifetime, Path, Result,
};

/// Implement `Bundle` for a monomorphic struct
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub trait SystemParam: Sized {
fn init(system_state: &mut SystemState, world: &World, resources: &mut Resources);
/// # Safety
/// This call might access any of the input parameters in a safe way. Make sure the data access is safe in
/// the context of the system scheduler
/// the context of the system scheduler
unsafe fn get_param(
system_state: &mut SystemState,
world: &World,
Expand Down
17 changes: 10 additions & 7 deletions examples/2d/contributors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ const COL_SELECTED: Color = Color::rgb_linear(5.0, 5.0, 5.0);
const SHOWCASE_TIMER_SECS: f32 = 3.0;

fn setup(
mut cmd: Commands,
commands: &mut Commands,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
let contribs = contributors();

let texture_handle = asset_server.load("branding/icon.png");

cmd.spawn(Camera2dComponents::default())
commands
.spawn(Camera2dComponents::default())
.spawn(UiCameraComponents::default());

let mut sel = ContributorSelection {
Expand All @@ -76,7 +77,8 @@ fn setup(
let mut transform = Transform::from_translation(Vec3::new(pos.0, pos.1, 0.0));
*transform.scale.x_mut() *= if flipped { -1.0 } else { 1.0 };

cmd.spawn((Contributor { color: col },))
commands
.spawn((Contributor { color: col },))
.with(Velocity {
translation: velocity,
rotation: -dir * 5.0,
Expand All @@ -94,16 +96,17 @@ fn setup(
})
.with(transform);

let e = cmd.current_entity().unwrap();
let e = commands.current_entity().unwrap();

sel.order.push((name, e));
}

sel.order.shuffle(&mut rnd);

cmd.spawn((SelectTimer, Timer::from_seconds(SHOWCASE_TIMER_SECS, true)));
commands.spawn((SelectTimer, Timer::from_seconds(SHOWCASE_TIMER_SECS, true)));

cmd.spawn((ContributorDisplay,))
commands
.spawn((ContributorDisplay,))
.with_bundle(TextComponents {
style: Style {
align_self: AlignSelf::FlexEnd,
Expand All @@ -120,7 +123,7 @@ fn setup(
..Default::default()
});

cmd.insert_resource(sel);
commands.insert_resource(sel);
}

/// Finds the next contributor to display and selects the entity
Expand Down

0 comments on commit 1c83a03

Please sign in to comment.