How focus-creative-games/il2cpp_plus works
Project type and purpose
• From the file tree and README, we see this is a small patch-style project (“il2cpp_plus”) that augments the IL2CPP AOT runtime in Unity to support dynamic DLL metadata registration.
• It is not a standalone application but a compiler/runtime extension that must be integrated with HybridCLR.
File structure
• Top level contains only metadata files (.gitignore, LICENSE, README.md). The actual C/C++ source must live on another branch or is merged into the upstream IL2CPP codebase.
• There are no “frontend”/“backend” folders—this is a native runtime patch.
• Expect to find in-code hook definitions, modified metadata management modules, and build scripts under IL2CPP’s original source tree when checked out on the correct branch.
README for insights
• Purpose: “lightly modify metadata management, insert hook code to support dynamic loading of dll metadata.”
• Dependency: Cannot compile or run alone; must be paired with HybridCLR interpreter.
• Branching: “main” is empty; you need to switch to the appropriate feature branch for source code.
a. Main components to include
• Unity Engine (host)
• IL2CPP AOT Runtime (original)
• il2cpp_plus Patch Module (hook layer)
• HybridCLR Interpreter
• Dynamic Metadata Loader (component or service)
• Managed DLLs (assemblies loaded at runtime)
• Build & Deployment Scripts (optional, for completeness)
b. Relationships and interactions
1. Unity launches → calls IL2CPP AOT Runtime initialization.
2. Patched IL2CPP (“il2cpp_plus”) intercepts metadata requests.
3. If a type or method is missing in static metadata, the hook forwards to the Dynamic Metadata Loader.
4. Dynamic Metadata Loader uses HybridCLR Interpreter APIs to load and parse external DLL metadata.
5. Newly loaded metadata is merged back into the IL2CPP metadata tables.
6. Execution continues in IL2CPP or HybridCLR as appropriate.
c. Architectural patterns & design principles
• Hook/Interceptor pattern: il2cpp_plus inserts minimal hooks into existing metadata APIs.
• Modular runtime extension: decoupling the metadata loader and interpreter from the core IL2CPP.
• Dependency inversion: core runtime calls into abstract hook interfaces rather than concrete implementations.
d. Key technologies & libraries
• C/C++ (IL2CPP source, hook implementations)
• HybridCLR (interpreter that supplies dynamic metadata APIs)
• Unity’s build pipeline & IL2CPP toolchain
Capturing essential architectural elements
• Call out optional fallback paths (static AOT vs. dynamic interpreter)