diff --git a/README.md b/README.md index c5bfec3..3dc937e 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ This package is used for code generation of bhl2 bindings for C# using Twig templates + +Usage example: + + $twig = \bhl_bind\bhl_twig(); + file_put_contents('autobind.cs', + $twig->render("codegen_register.twig", + ['imports' => ['UnityEngine'], + 'units' => $meta->getUnits()] + ) + ); \ No newline at end of file diff --git a/tpl/macro.twig b/tpl/macro.twig index 25a3ee0..79f4fd2 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -379,6 +379,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack for(int i=0;i 1) { + if(args_info.CountArgs() > 1) dv = stack.Pop(); - } {%- endif ~%} EcsEntity e = default;