leanclr-unity (package com.code-philosophy.leanclr) is the Unity integration package for LeanCLR. It replaces IL2CPP with LeanCLR when you ship to WebGL, mini-game, and similar targets.
With selective AOT via aot.xml / PGO, compared to IL2CPP full AOT you typically get:
- AOT code size: about 70%–90% less native code from managed compilation (hot/necessary methods AOT’d; rest interpreted with controllable performance impact)
- Memory: about 20%–35% lower VM memory, plus a modest drop in managed heap use
- Large projects: lazy load and hot update support tens of MB of managed logic while meeting mini-game package limits
- GC: precise mark-sweep GC with higher reclamation efficiency and faster collections
See the Unity integration docs.
Full documentation: https://doc.leanclr.com
| Topic | Link |
|---|---|
| Unity integration overview | doc.leanclr.com/docs/ecosystem/unity/ |
| Installation | Install |
| Project settings | Settings |
| Concepts (AOT / lazy load / hot update) | Concepts |
| Build & CompileDll | Build |
| Code hot update | Hot update |
| Runtime & AOT | LeanCLR docs home |
In Unity Package Manager → Add package from git URL, use:
https://github.com/focus-creative-games/leanclr-unity.githttps://gitee.com/focus-creative-games/leanclr-unity.git
After install, open LeanCLR → Settings..., enable the integration, and follow the docs to publish a Player. Sample project: leanclr-unity-demo.
| Repository | Description |
|---|---|
| leanclr | LeanCLR runtime and toolchain |
| leanclr-doc | Documentation site source |
| hybridclr | Unity native C# hot update (complementary) |
- Email:
leanclr#code-philosophy.com - Discord: https://discord.gg/esAYcM6RDQ
- QQ Group: 1047250380