File tree Expand file tree Collapse file tree 7 files changed +9
-51
lines changed
bevy_transform/src/components Expand file tree Collapse file tree 7 files changed +9
-51
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ impl App {
343
343
/// A resource in Bevy represents globally unique data. Resources must be added to Bevy Apps
344
344
/// before using them. This happens with [`App::insert_resource`].
345
345
///
346
- /// See also `init_resource` for resources that implement `Default` or [`FromResources `].
346
+ /// See also `init_resource` for resources that implement `Default` or [`FromWorld `].
347
347
///
348
348
/// ## Example
349
349
/// ```
@@ -390,7 +390,7 @@ impl App {
390
390
391
391
/// Initialize a resource in the current [App], if it does not exist yet
392
392
///
393
- /// Adds a resource that implements `Default` or [`FromResources `] trait.
393
+ /// Adds a resource that implements `Default` or [`FromWorld `] trait.
394
394
/// If the resource already exists, `init_resource` does nothing.
395
395
///
396
396
/// ## Example
Original file line number Diff line number Diff line change @@ -7,18 +7,10 @@ mod enum_variant_meta;
7
7
mod modules;
8
8
mod render_resource;
9
9
mod render_resources;
10
- mod resource;
11
10
mod shader_defs;
12
11
13
12
use proc_macro:: TokenStream ;
14
13
15
- /// Derives the FromResources trait. Each field must also implement the FromResources trait or this
16
- /// will fail. FromResources is automatically implemented for types that implement Default.
17
- #[ proc_macro_derive( FromResources ) ]
18
- pub fn derive_from_resources ( input : TokenStream ) -> TokenStream {
19
- resource:: derive_from_resources ( input)
20
- }
21
-
22
14
/// Derives the Bytes trait. Each field must also implements Bytes or this will fail.
23
15
#[ proc_macro_derive( Bytes ) ]
24
16
pub fn derive_bytes ( input : TokenStream ) -> TokenStream {
Original file line number Diff line number Diff line change 1
- pub const BEVY_APP : & str = "bevy_app" ;
2
1
pub const BEVY_ASSET : & str = "bevy_asset" ;
3
2
pub const BEVY_CORE : & str = "bevy_core" ;
4
3
pub const BEVY_RENDER : & str = "bevy_render" ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ impl MapEntities for PreviousParent {
52
52
}
53
53
}
54
54
55
- // TODO: Better handle this case see `impl FromResources for Parent`
55
+ // TODO: Better handle this case see `impl FromWorld for Parent`
56
56
impl FromWorld for PreviousParent {
57
57
fn from_world ( _world : & mut World ) -> Self {
58
58
PreviousParent ( Entity :: new ( u32:: MAX ) )
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ fn main() {
272
272
// that :) The plugin below runs our app's "system schedule" once every 5 seconds
273
273
// (configured above).
274
274
. add_plugin ( ScheduleRunnerPlugin :: default ( ) )
275
- // Resources that implement the Default or FromResources trait can be added like this:
275
+ // Resources that implement the Default or FromWorld trait can be added like this:
276
276
. init_resource :: < GameState > ( )
277
277
// Startup systems run exactly once BEFORE all other systems. These are generally used for
278
278
// app initialization code (ex: adding entities and resources)
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ fn main() {
13
13
. run ( ) ;
14
14
}
15
15
16
- // Registered components must implement the `Reflect` and `FromResources ` traits.
16
+ // Registered components must implement the `Reflect` and `FromWorld ` traits.
17
17
// The `Reflect` trait enables serialization, deserialization, and dynamic property access.
18
18
// `Reflect` enable a bunch of cool behaviors, so its worth checking out the dedicated `reflect.rs`
19
- // example. The `FromResources ` trait determines how your component is constructed when it loads.
19
+ // example. The `FromWorld ` trait determines how your component is constructed when it loads.
20
20
// For simple use cases you can just implement the `Default` trait (which automatically implements
21
- // FromResources ). The simplest registered component just needs these two derives:
21
+ // FromWorld ). The simplest registered component just needs these two derives:
22
22
#[ derive( Reflect , Default ) ]
23
23
#[ reflect( Component ) ] // this tells the reflect derive to also reflect component behaviors
24
24
struct ComponentA {
@@ -27,8 +27,8 @@ struct ComponentA {
27
27
}
28
28
29
29
// Some components have fields that cannot (or should not) be written to scene files. These can be
30
- // ignored with the #[reflect(ignore)] attribute. This is also generally where the `FromResources `
31
- // trait comes into play. `FromResources ` gives you access to your App's current ECS `Resources`
30
+ // ignored with the #[reflect(ignore)] attribute. This is also generally where the `FromWorld `
31
+ // trait comes into play. `FromWorld ` gives you access to your App's current ECS `Resources`
32
32
// when you construct your component.
33
33
#[ derive( Reflect ) ]
34
34
#[ reflect( Component ) ]
You can’t perform that action at this time.
0 commit comments