Open christianlarrabure opened 1 month ago
Hey! It looks like you're using multiple separate script hosts, which should work but is not really how the library was intended to be used. Because the lua script host supports anything that converts into lua via IntoLuaMulti
you should be able to have a single enum type on which you implement IntoLuaMulti yourself to get this behavior
Hey, I want to have some events that have no arguments and others that have other arguments. Right now my approach is this: `rust
And then some events are:
rust fn do_update(mut lua_events: PriorityEventWriter<LuaEvent<()>>) { lua_events.send( LuaEvent { hook_name: "on_update".to_owned(), args: (), recipients: Recipients::All, }, 0, ) }
And others are:
rust fn on_player_connected( query: Query<Entity, Added<PlayerConnection>>, mut lua_events: PriorityEventWriter<LuaEvent<LuaEntity>>, ) { for item in query.iter() { lua_events.send( LuaEvent { hook_name: "internal_onPlayerConnected".to_owned(), args: LuaEntity::new(item), recipients: Recipients::All, }, 0, ) } }
However, this doesn't seem to work? Any ideas?