From f9a7a9eb77134b13b7251f037965c7e466a127d5 Mon Sep 17 00:00:00 2001 From: Jaroslaw Konik Date: Tue, 27 May 2025 07:00:00 +0200 Subject: [PATCH] cleanup docs --- book/src/lua/calling_script_from_rust.md | 4 ---- book/src/lua/spawning_scripts.md | 4 ---- book/src/ruby/calling_script_from_rust.md | 4 ---- book/src/ruby/spawning_scripts.md | 4 ---- book/src/workflow/live_reload.md | 14 +++++--------- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/book/src/lua/calling_script_from_rust.md b/book/src/lua/calling_script_from_rust.md index f572431..c42fb08 100644 --- a/book/src/lua/calling_script_from_rust.md +++ b/book/src/lua/calling_script_from_rust.md @@ -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 diff --git a/book/src/lua/spawning_scripts.md b/book/src/lua/spawning_scripts.md index 9cabc3b..8acd82d 100644 --- a/book/src/lua/spawning_scripts.md +++ b/book/src/lua/spawning_scripts.md @@ -16,8 +16,6 @@ fn my_spawner(mut commands: Commands, assets_server: Res) { 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() {} ``` diff --git a/book/src/ruby/calling_script_from_rust.md b/book/src/ruby/calling_script_from_rust.md index f572431..c42fb08 100644 --- a/book/src/ruby/calling_script_from_rust.md +++ b/book/src/ruby/calling_script_from_rust.md @@ -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 diff --git a/book/src/ruby/spawning_scripts.md b/book/src/ruby/spawning_scripts.md index 9cabc3b..8acd82d 100644 --- a/book/src/ruby/spawning_scripts.md +++ b/book/src/ruby/spawning_scripts.md @@ -16,8 +16,6 @@ fn my_spawner(mut commands: Commands, assets_server: Res) { 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() {} ``` diff --git a/book/src/workflow/live_reload.md b/book/src/workflow/live_reload.md index 4c2a283..5bd90bf 100644 --- a/book/src/workflow/live_reload.md +++ b/book/src/workflow/live_reload.md @@ -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.