1
- use bevy:: asset:: ChangeWatcher ;
2
1
use bevy:: prelude:: * ;
3
2
use bevy_mod_scripting:: prelude:: * ;
4
3
use rand:: prelude:: SliceRandom ;
5
4
use std:: sync:: atomic:: AtomicU32 ;
6
5
use std:: sync:: atomic:: Ordering :: Relaxed ;
7
- use std:: time:: Duration ;
8
6
9
7
#[ derive( Clone ) ]
10
8
pub struct MyRuneArg ( usize ) ;
@@ -96,7 +94,7 @@ fn load_scripts(server: Res<AssetServer>, mut commands: Commands) {
96
94
// Spawn two identical scripts.
97
95
// Their id's will be 0 and 1.
98
96
let path = "scripts/event_recipients.rune" ;
99
- let handle = server. load :: < RuneFile , & str > ( path) ;
97
+ let handle = server. load :: < RuneFile > ( path) ;
100
98
let scripts = ( 0 ..2 )
101
99
. map ( |_| Script :: < RuneFile > :: new ( path. to_string ( ) , handle. clone ( ) ) )
102
100
. collect ( ) ;
@@ -108,10 +106,7 @@ fn load_scripts(server: Res<AssetServer>, mut commands: Commands) {
108
106
109
107
fn main ( ) {
110
108
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 )
115
110
. add_plugins ( ScriptingPlugin )
116
111
. add_systems ( Startup , load_scripts)
117
112
// Randomly fire events for either all scripts, the script with an id of `0`,
0 commit comments