Skip to content

Commit 08df14b

Browse files
committed
modify docs
1 parent bdfac79 commit 08df14b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/src/Summary/managing-scripts.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ fn load_script(asset_server: Res<AssetServer>, mut commands: Commands) {
4949
commands.spawn(ScriptComponent(vec![handle]));
5050
}
5151
```
52+
53+
<div class="warning">
54+
55+
Prefer using strong asset handles, internal references will only persist weak versions of the handle, leaving you in control of the asset handle via the container component.
56+
57+
</div>
58+
5259
### Create `ScriptAsset` and Add It
5360
```rust
5461
# extern crate bevy;
@@ -64,6 +71,11 @@ fn add_script(mut script_assets: ResMut<Assets<ScriptAsset>>, mut commands: Comm
6471
commands.spawn(ScriptComponent(vec![handle]));
6572
}
6673
```
74+
<div class="warning">
75+
76+
Scripts added directly through assets, or via asset server without an asset path, will not contain path information, and logs will be slightly less useful.
77+
78+
</div>
6779

6880
## Static Scripts
6981
You can use attach and detach commands, which will run the [script pipeline](../ScriptPipeline/pipeline.md), repeatedly until the requested script attachments are processed. If you don't want to incur big frametime slowdowns, you can instead send `ScriptAttachedEvent` and `ScriptDetachedEvent` manually, and let the pipeline pick these up as normal.

0 commit comments

Comments
 (0)