mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
fix dynamic plugin example
This commit is contained in:
parent
65d072fc6a
commit
057ad97a46
4 changed files with 6 additions and 6 deletions
|
@ -47,6 +47,7 @@ glam = "0.8.6"
|
|||
[workspace]
|
||||
members = [
|
||||
"crates/*",
|
||||
"examples/dynamic_plugin_loading/example_plugin"
|
||||
]
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -476,7 +476,7 @@ pub fn derive_app_plugin(input: TokenStream) -> TokenStream {
|
|||
|
||||
TokenStream::from(quote! {
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _create_plugin() -> *mut bevy::app::plugin::AppPlugin {
|
||||
pub extern "C" fn _create_plugin() -> *mut bevy::app::AppPlugin {
|
||||
// TODO: without this the assembly does nothing. why is that the case?
|
||||
print!("");
|
||||
// make sure the constructor is the correct type.
|
||||
|
|
|
@ -4,8 +4,8 @@ use bevy::prelude::*;
|
|||
pub struct ExamplePlugin;
|
||||
|
||||
impl AppPlugin for ExamplePlugin {
|
||||
fn build(&self, app_builder: AppBuilder) -> AppBuilder {
|
||||
app_builder.setup(setup)
|
||||
fn build(&self, app_builder: &mut AppBuilder) {
|
||||
app_builder.add_startup_system(setup);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,5 @@ pub fn setup(world: &mut World, resources: &mut Resources) {
|
|||
Vec3::new(0.0, 0.0, 1.0),
|
||||
)),
|
||||
..Default::default()
|
||||
})
|
||||
.build();
|
||||
});
|
||||
}
|
|
@ -5,7 +5,7 @@ fn main() {
|
|||
.add_default_plugins()
|
||||
.load_plugin(concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/examples/dynamic_plugin_loading/example_plugin/target/release/libexample_plugin.so"
|
||||
"/target/debug/libexample_plugin.so"
|
||||
))
|
||||
.run();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue