Uniti
Overview
Section titled “Overview”uniti is the C FFI bridge that exposes the KBVE Bevy game-logic crates to the Unity runtime used by RareIcon. It compiles as a cdylib and is loaded by Unity as a native plugin.
Bindings on the C# side are generated by csbindgen at build time and committed to the Unity project as Uniti.g.cs.
Bundled Crates
Section titled “Bundled Crates”| Crate | Purpose |
|---|---|
bevy_pathfinding | Grid flow-field navigation + chokepoint detection |
bevy_inventory | Item / slot persistence |
bevy_battle | Combat resolution |
bevy_skills | Skill / proc tables |
Plus two runtime helpers compiled into the dylib so Unity does not need them on the host:
rusqlitewith thebundledfeature — save-archive persistence, no systemlibsqlite3dep.zstdwith default features disabled — pure-Rust compression for save blobs.
Build Targets
Section titled “Build Targets”Each Nx target builds the release cdylib and copies it into the Unity Plugins/ tree for the matching platform.
npx nx run uniti:build:macosnpx nx run uniti:build:windowsnpx nx run uniti:build:linuxnpx nx run uniti:build:allOn macOS the target also runs xattr -cr and an adhoc codesign --force --deep --sign - so the dylib loads through Gatekeeper without a quarantine prompt.
Generated Bindings
Section titled “Generated Bindings”build.rs invokes csbindgen and writes the C# wrapper to:
apps/rareicon/unity-rareicon/Assets/_RareIcon/Scripts/Native/Uniti.g.csHand-written wrapper classes live alongside it under Native/Wrappers/ (for example NativeWorld).
Tracked in the dispatch manifest under the crates pipeline. The standard test / lint nx targets are wired:
npx nx run uniti:testnpx nx run uniti:lintLicense
Section titled “License”MIT