Ruby support #1
2 changed files with 3 additions and 2 deletions
|
|
@ -111,13 +111,13 @@ macro_rules! impl_tuple {
|
||||||
let system_fn = move |args: In<Vec<RN::Value>>, world: &mut World| {
|
let system_fn = move |args: In<Vec<RN::Value>>, world: &mut World| {
|
||||||
let mut runtime = world.get_resource_mut::<RN>().expect("No runtime resource");
|
let mut runtime = world.get_resource_mut::<RN>().expect("No runtime resource");
|
||||||
let args = if RN::needs_own_thread() {
|
let args = if RN::needs_own_thread() {
|
||||||
runtime.with_engine_mut(move |engine| {
|
runtime.with_engine_thread_mut(move |engine| {
|
||||||
(
|
(
|
||||||
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
|
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
runtime.with_engine_thread_mut(move |engine| {
|
runtime.with_engine_mut(move |engine| {
|
||||||
(
|
(
|
||||||
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
|
$($t::from_runtime_value_with_engine(args.get($idx).expect(&format!("Failed to get function argument for index {}", $idx)).clone(), engine), )+
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// TODO: install with CC=clang rbenv install 3.4.3
|
// TODO: install with CC=clang rbenv install 3.4.3
|
||||||
// TODO: adjust rhai examples and docs or maybe more rhai changes to different PR or even better
|
// TODO: adjust rhai examples and docs or maybe more rhai changes to different PR or even better
|
||||||
// find a better way to test them(dont wrap, generic bevy etc)
|
// find a better way to test them(dont wrap, generic bevy etc)
|
||||||
|
// TODO: Move with_engine_thread and with_engine to 2 separate traits
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue