Open dgriffith0 opened 3 months ago
On Main branch calling with a single argument tuple or single argument in either direction doesn't work.
Calling Rust from Lua
fn main() { App::new() .add_plugins(DefaultPlugins) .add_scripting::<LuaRuntime>(|runtime| { runtime.add_function(String::from("func_with_params"), |In((a)): In<(i64)>| { //doesnt compile trait bounds not satisfied. }); }) .run(); }
Calling Lua from Rust
fn call_lua_on_update_from_rust( mut scripted_entities: Query<(Entity, &mut LuaScriptData)>, scripting_runtime: ResMut<LuaRuntime>, ) { for (entity, mut script_data) in &mut scripted_entities { scripting_runtime .call_fn("on_update", &mut script_data, entity, (123)) //FuncArgs not satisfied .unwrap(); } } function on_update(a) print(a) -- 123 end
Calling Lua from Rust will work if I replace the single argument tuple with a vec e.g. vec![123]
On Main branch calling with a single argument tuple or single argument in either direction doesn't work.
Calling Rust from Lua
Calling Lua from Rust
Calling Lua from Rust will work if I replace the single argument tuple with a vec e.g. vec![123]