Skip to content

Commit 7e61c30

Browse files
committed
fix rune example
1 parent bb93162 commit 7e61c30

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"lua_script_api",
99
"rhai",
1010
"rhai_script_api",
11-
"teal"
11+
"teal",
12+
"rune"
1213
],
1314
"rust-analyzer.server.extraEnv": {
1415
"RUSTUP_TOOLCHAIN": "stable"

examples/rune/event_recipients.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
use bevy::asset::ChangeWatcher;
21
use bevy::prelude::*;
32
use bevy_mod_scripting::prelude::*;
43
use rand::prelude::SliceRandom;
54
use std::sync::atomic::AtomicU32;
65
use std::sync::atomic::Ordering::Relaxed;
7-
use std::time::Duration;
86

97
#[derive(Clone)]
108
pub struct MyRuneArg(usize);
@@ -96,7 +94,7 @@ fn load_scripts(server: Res<AssetServer>, mut commands: Commands) {
9694
// Spawn two identical scripts.
9795
// Their id's will be 0 and 1.
9896
let path = "scripts/event_recipients.rune";
99-
let handle = server.load::<RuneFile, &str>(path);
97+
let handle = server.load::<RuneFile>(path);
10098
let scripts = (0..2)
10199
.map(|_| Script::<RuneFile>::new(path.to_string(), handle.clone()))
102100
.collect();
@@ -108,10 +106,7 @@ fn load_scripts(server: Res<AssetServer>, mut commands: Commands) {
108106

109107
fn main() {
110108
App::new()
111-
.add_plugins(DefaultPlugins.set(AssetPlugin {
112-
watch_for_changes: ChangeWatcher::with_delay(Duration::from_secs(0)),
113-
..Default::default()
114-
}))
109+
.add_plugins(DefaultPlugins)
115110
.add_plugins(ScriptingPlugin)
116111
.add_systems(Startup, load_scripts)
117112
// Randomly fire events for either all scripts, the script with an id of `0`,

0 commit comments

Comments
 (0)