Skip to content

Commit 7d4af77

Browse files
committed
fix arg conversions and import
1 parent 34ff684 commit 7d4af77

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

crates/bevy_api_gen/templates/footer.tera

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,20 @@ impl ::bevy::app::Plugin for {{ "ScriptingPlugin" | prefix_cratename | convert_c
2626
| {
2727
let output: {{ function.output.proxy_ty }} = ::{{ item.import_path }}::{{ function.ident }}(
2828
{%- for arg in function.args -%}
29+
{%- if arg.proxy_ty is matching("Ref.*")-%}
30+
&
31+
{%- endif -%}
32+
{%- if arg.proxy_ty is matching ("Mut.*")-%}
33+
&mut
34+
{%- endif -%}
2935
{%- if arg.ident != "self" -%}
3036
{{- arg.ident -}}
3137
{%- else -%}
3238
_{{- arg.ident -}}
33-
{%- endif -%}.into(),
39+
{%- endif -%}
40+
{%- if arg.proxy_ty is matching("Val.*")-%}
41+
.into()
42+
{%- endif -%},
3443
{%- endfor -%}
3544
).into();
3645
output

crates/bevy_api_gen/templates/header.tera

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bevy_mod_scripting_core::{
1818
}
1919
};
2020
{% if args.self_is_bms_lua %}
21-
use crate::*;
21+
use crate::{*, namespaced_register::NamespaceBuilder};
2222
{% else %}
23-
use bevy_mod_scripting_lua::*;
23+
use bevy_mod_scripting_lua::{*, namespaced_register::NamespaceBuilder};;
2424
{% endif %}

0 commit comments

Comments
 (0)