[dependencies]
unity-native-plugin = { version = "*", features = ["d3d11"] }
* If you use Vulkan, define "unity-native-plugin-vulkan" in your dependencies.
```cargo
[dependencies]
unity-native-plugin = "*"
unity-native-plugin-vulkan = "*"
Use a macro in lib.rs to define your entry points. Without this definition, UnityInterfaces cannot be used.
unity_native_plugin::unity_native_plugin_entry_point! {
fn unity_plugin_load(interfaces: &unity_native_plugin::interface::UnityInterfaces) {
// called UnityPluginLoad
}
fn unity_plugin_unload() {
// called UnityPluginUnload
}
}
Use UnityInterface::interface, which is equivalent to IUnityInterfaces::GetInterface, to get the interface.
let intf = unity_native_plugin::interface::UnityInterfaces::get()
.interface::<unity_native_plugin::d3d11::UnityGraphicsD3D11>();