1- use bevy:: asset:: ChangeWatcher ;
21use bevy:: prelude:: * ;
32use bevy_mod_scripting:: prelude:: * ;
43use rand:: prelude:: SliceRandom ;
54use std:: sync:: atomic:: AtomicU32 ;
65use std:: sync:: atomic:: Ordering :: Relaxed ;
7- use std:: time:: Duration ;
86
97#[ derive( Clone ) ]
108pub 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
109107fn 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