Skip to content

Commit 91c953d

Browse files
committed
fix more docs
1 parent de1e27b commit 91c953d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

docs/src/Summary/customizing-script-contexts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use bevy::prelude::*;
3333
use bevy_mod_scripting::prelude::*;
3434
fn scripting_plugin(app: &mut App) {
3535
app.add_plugins(LuaScriptingPlugin::default()
36-
.add_context_pre_handling_initializer(|context_key: &ContextKey, entity: Entity, context: &mut Lua| {
36+
.add_context_pre_handling_initializer(|context_key: &ContextKey, context: &mut Lua| {
3737
let globals = context.globals();
3838
if let Some(script_id) = context_key.script_id.as_ref() {
3939
globals.set("script_name", script_id.to_owned());

docs/src/Summary/running-scripts.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ Be wary of path separators, by default script ID's are derived from asset paths,
2525

2626
## Making static scripts runnable
2727

28-
Some scripts do not require attaching to an entity. You can run these scripts by loading them first as you would with any other script, then either adding them at app level via `add_static_script` or by issuing a `AddStaticScript` command like so:
28+
Some scripts do not require attaching to an entity. You can run these scripts by loading them first as you would with any other script, then either adding them by issuing a `AttachScript` command like so:
2929

3030
```rust,ignore
31-
commands.queue(AddStaticScript::new(my_script_handle));
31+
commands.queue(AttachScript::new(script_attachment));
3232
```
3333

34-
The script will then be run as any other script but without being attached to any entity. and as such the `entity` global will always represent an invalid entity.
35-
36-
Note: Internally these scripts are attached to a dummy entity and as such you can think of them as being attached to an entity with an id of `0`.
34+
The script will then be run as any other script but without being attached to any entity.
3735

3836
# Running Scripts
3937

0 commit comments

Comments
 (0)