From 511053bb5c734cef3c8bb0271b44010170024df0 Mon Sep 17 00:00:00 2001 From: neuecc Date: Tue, 15 Aug 2023 19:56:27 +0900 Subject: [PATCH] ReadMe for csharp_imported_namespaces --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 6336932..efdacee 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,7 @@ csbindgen::Builder::default() .csharp_method_prefix("") // optional, default: "" .csharp_use_function_pointer(true) // optional, default: true .csharp_disable_emit_dll_name(false) // optional, default: false + .csharp_imported_namespaces("MyLib") // optional, default: empty .csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal") // optional, default: "" .generate_csharp_file("../dotnet-sandbox/NativeMethods.cs") // required .unwrap(); @@ -181,6 +182,7 @@ csbindgen::Builder::default() ```csharp using System; using System.Runtime.InteropServices; +using {csharp_imported_namespaces}; namespace {csharp_namespace} { @@ -211,6 +213,8 @@ csbindgen::Builder::default() .generate_csharp_file("../dotnet-sandbox/NativeMethods.cs"); ``` +also `csharp_imported_namespaces` can call multiple times. + ### Unity Callback `csharp_use_function_pointer` configures how generate function pointer. The default is to generate a `delegate*`, but Unity does not support it; setting it to `false` will generate a `Func/Action` that can be used with `MonoPInvokeCallback`. @@ -262,6 +266,7 @@ csbindgen::Builder::default() .csharp_entry_point_prefix("csbindgen_") // required, you must set same as rust_method_prefix .csharp_method_prefix("") // optional, default: "" .csharp_use_function_pointer(true) // optional, default: true + .csharp_imported_namespaces("MyLib") // optional, default: empty .csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal") // optional, default: "" .generate_to_file("src/lz4_ffi.rs", "../dotnet-sandbox/lz4_bindgen.cs") // required .unwrap();