cleanup docs
This commit is contained in:
parent
97077338f9
commit
f9a7a9eb77
5 changed files with 5 additions and 25 deletions
|
|
@ -32,8 +32,6 @@ fn call_lua_on_update_from_rust(
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
We can also pass some arguments by providing a tuple or `Vec` as the last
|
||||
|
|
@ -57,8 +55,6 @@ fn call_lua_on_update_from_rust(
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
They will be passed to `on_update` Lua function
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ fn my_spawner(mut commands: Commands, assets_server: Res<AssetServer>) {
|
|||
assets_server.load("my_script.lua"),
|
||||
));
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
After they scripts have been evaled by bevy_scriptum, the entities that they've
|
||||
|
|
@ -41,6 +39,4 @@ fn my_system(
|
|||
// do something with scripted entities
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ fn call_lua_on_update_from_rust(
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
We can also pass some arguments by providing a tuple or `Vec` as the last
|
||||
|
|
@ -57,8 +55,6 @@ fn call_lua_on_update_from_rust(
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
They will be passed to `on_update` Lua function
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ fn my_spawner(mut commands: Commands, assets_server: Res<AssetServer>) {
|
|||
assets_server.load("my_script.lua"),
|
||||
));
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
After they scripts have been evaled by bevy_scriptum, the entities that they've
|
||||
|
|
@ -41,6 +39,4 @@ fn my_system(
|
|||
// do something with scripted entities
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -95,8 +95,6 @@ fn teardown(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
And to tie this all together we do the following:
|
||||
|
|
@ -122,11 +120,11 @@ fn main() {
|
|||
.run();
|
||||
}
|
||||
|
||||
fn init() {} // Implemented elsewhere
|
||||
fn update() {} // Implemented elsewhere
|
||||
fn despawn() {} // Implemented elsewhere
|
||||
fn teardown() {} // Implemented elsewhere
|
||||
fn spawn_player() {} // Implemented elsewhere
|
||||
# fn init() {}
|
||||
# fn update() {}
|
||||
# fn despawn() {}
|
||||
# fn teardown() {}
|
||||
# fn spawn_player() {}
|
||||
```
|
||||
|
||||
`despawn` can be implemented as:
|
||||
|
|
@ -141,8 +139,6 @@ use bevy_scriptum::runtimes::lua::prelude::*;
|
|||
fn despawn(In((entity,)): In<(BevyEntity,)>, mut commands: Commands) {
|
||||
commands.entity(entity.0).despawn();
|
||||
}
|
||||
|
||||
fn main() {} // Implemented elsewhere
|
||||
```
|
||||
|
||||
Implementation of `spawn_player` has been left out as an exercise for the reader.
|
||||
|
|
|
|||
Loading…
Reference in a new issue