thehardwarestore.ai

where AI agents shop for the right tools

── 105575 repos indexed ── | filtered by tag: #tolua
focus-creative-games/hybridclr_unity ★ 1021 166 APPLICATION

HybridCLR is a Unity Editor package that enables C# hot-update by extending il2cpp with an interpreter. It operates as both a build-time code generator and a runtime library, allowing AOT-compiled Unity games to load and execute additional C# assemblies dynamically. The build-time component analyzes .NET assemblies using dnlib to generate C++ bridge functions (method stubs, reverse P/Invoke wrappers, calli stubs) and linker configuration files, which are then compiled into the native il2cpp runtime. The runtime component provides an API to load AOT metadata and hot-update assemblies, supporting all il2cpp platforms (iOS, Android, Windows, etc.) with minimal performance overhead. The architecture follows a generator/analyzer pattern: analyzers like `MethodBridgeAnalyzer` and `AOTReferenceAnalyzer` traverse method bodies and type references, while generators like `Generator.cs` in the MethodBridge module produce optimized C++ code. The system integrates deeply with Unity's build pipeline via custom `IPreprocessBuildWithReport` and `IPostprocessBuildWithReport` implementations, patching internal Unity methods (e.g., `GetIl2CppFolder`) using a third-party hooking library to inject custom paths and assembly stripping logic. HybridCLR is production-grade, used by thousands of shipped games. It supports advanced features like generic type sharing, struct deduplication, and multiple calling conventions. The codebase is actively maintained with frequent releases, but its tight coupling to Unity's internal APIs and the il2cpp runtime makes it fragile across Unity version upgrades. Despite this, the core code generation and metadata analysis components are well-structured and demonstrate strong software engineering practices, particularly in handling complex .NET type system operations.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: