{"id":14960314,"url":"https://github.com/focus-creative-games/hybridclr","last_synced_at":"2025-05-13T15:11:15.079Z","repository":{"id":41611991,"uuid":"510313729","full_name":"focus-creative-games/hybridclr","owner":"focus-creative-games","description":"HybridCLR是一个特性完整、零成本、高性能、低内存的Unity全平台原生c#热更新解决方案。 HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.","archived":false,"fork":false,"pushed_at":"2025-05-02T02:42:45.000Z","size":11331,"stargazers_count":7048,"open_issues_count":0,"forks_count":697,"subscribers_count":89,"default_branch":"main","last_synced_at":"2025-05-02T03:28:56.397Z","etag":null,"topics":["csharp","framework","hot","hot-update","hotfix","hotupdate","huatuo","il2cpp","ios","unity","update"],"latest_commit_sha":null,"homepage":"https://code-philosophy.com/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/focus-creative-games.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://raw.githubusercontent.com/focus-creative-games/hybridclr/main/docs/sponsor/weixin.JPG","https://raw.githubusercontent.com/focus-creative-games/hybridclr/main/docs/sponsor/zhifubao.JPG"]}},"created_at":"2022-07-04T10:29:45.000Z","updated_at":"2025-05-02T02:42:49.000Z","dependencies_parsed_at":"2022-07-06T23:33:06.310Z","dependency_job_id":"42ba6c1b-5c29-4900-916e-bd1186250296","html_url":"https://github.com/focus-creative-games/hybridclr","commit_stats":{"total_commits":573,"total_committers":14,"mean_commits":40.92857142857143,"dds":0.6003490401396161,"last_synced_commit":"dd1cd8c22430a8dd2d7aabe99db837a040ec94e4"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fhybridclr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fhybridclr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fhybridclr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fhybridclr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/focus-creative-games","download_url":"https://codeload.github.com/focus-creative-games/hybridclr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969259,"owners_count":21992263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","framework","hot","hot-update","hotfix","hotupdate","huatuo","il2cpp","ios","unity","update"],"created_at":"2024-09-24T13:22:01.964Z","updated_at":"2025-05-13T15:11:10.064Z","avatar_url":"https://github.com/focus-creative-games.png","language":"C++","funding_links":["https://raw.githubusercontent.com/focus-creative-games/hybridclr/main/docs/sponsor/weixin.JPG","https://raw.githubusercontent.com/focus-creative-games/hybridclr/main/docs/sponsor/zhifubao.JPG"],"categories":["Open Source Repositories","C++"],"sub_categories":["Scriptings"],"readme":"- [README 中文](./README.md)\n- [README English](./README_EN.md)\n\n# HybridCLR\n\n[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/focus-creative-games/hybridclr/blob/main/LICENSE)\n\n![logo](./docs/images/logo.jpg)\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\nHybridCLR是一个**特性完整、零成本、高性能、低内存**的**近乎完美**的Unity全平台原生c#热更新解决方案。\n\nHybridCLR扩充了il2cpp运行时代码，使它由纯[AOT](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) runtime变成AOT+Interpreter 混合runtime，进而原生支持动态加载assembly，从底层彻底支持了热更新。使用HybridCLR技术的游戏不仅能在Android平台，也能在IOS、Consoles、WebGL等所有il2cpp支持的平台上高效运行。\n\n由于HybridCLR对ECMA-335规范 的良好支持以及对Unity开发工作流的高度兼容，Unity项目在接入HybridCLR后，可以几乎无缝地获得C#代码热更新的能力，开发者不需要改变日常开发习惯和要求。HybridCLR首次实现了将Unity平台的全平台代码热更新方案的工程难度降到几乎为零的水平。\n\n欢迎拥抱现代原生C#热更新技术 ！！！\n\n## 文档\n\n- [官方文档](https://hybridclr.doc.code-philosophy.com/docs/intro)\n- [快速上手](https://hybridclr.doc.code-philosophy.com/docs/beginner/quickstart)\n- [商业项目案例](https://hybridclr.doc.code-philosophy.com/docs/other/businesscase)\n\n\n## 特性\n\n- 近乎完整实现了[ECMA-335规范](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/)，只有极少量的[不支持的特性](https://hybridclr.doc.code-philosophy.com/docs/basic/notsupportedfeatures)。\n- 零学习和使用成本。对绝大多数开发者来说写代码近乎没有限制。 热更新代码与AOT代码无缝工作，可以随意写继承、**泛型**、**反射**之类的代码。不需要额外写任何特殊代码、没有代码生成\n- 完全支持多线程，包含但不限于 volatile、ThreadStatic、async Task等相关功能和特性。这是其他所有热更新方案都不支持的\n- 几乎完全兼容Unity的工作流。包括且不限于支持热更新**MonoBehaviour**、ScriptableObject、**DOTS**技术，资源上挂载的热更新脚本可以正确实例化，这是其他所有热更新方案都不支持的\n- 执行高效。实现了一个极其高效的寄存器解释器，所有指标都大幅优于其他热更新方案。[性能测试报告](https://hybridclr.doc.code-philosophy.com/docs/basic/performance)\n- 内存高效。 热更新脚本中定义的类跟普通c#类占用一样的内存空间，远优于其他热更新方案。[内存占用报告](https://hybridclr.doc.code-philosophy.com/docs/basic/memory)\n- 支持MonoPInvokeCallback，可以与native代码或者其他语言如lua、javascript、python良好交互\n- 支持一些il2cpp不支持的特性，如__makeref、 __reftype、__refvalue指令\n- 支持独创的 **Differential Hybrid Execution(DHE)** 差分混合执行技术，即可以对AOT dll任意增删改，会智能地让未改动的函数以AOT方式运行，变化或者新增的函数以interpreter模式运行，让热更新的游戏逻辑的运行性能基本达到原生AOT的水平\n- 支持 **热重载** 技术，可以100%卸载程序集\n- 支持 **热修复** 技术，不需要重启游戏即可无感修复bug\n- 支持现代的dll加密技术，有效保障代码安全\n\n## 支持的版本与平台\n\n- 支持2019.4.x、2020.3.x、2021.3.x、2022.3.x、2023.2.x、6000.0.x全系列LTS版本\n- 支持所有il2cpp支持的平台\n- 支持团结引擎和鸿蒙平台\n\n## 工作原理\n\nHybridCLR从mono的 [mixed mode execution](https://www.mono-project.com/news/2017/11/13/mono-interpreter/) 技术中得到启发，为unity的il2cpp之类的AOT runtime额外提供了interpreter模块，将它们由纯AOT运行时改造为\"AOT + Interpreter\"混合运行方式。\n\n![icon](docs/images/architecture.png)\n\n更具体地说，HybridCLR做了以下几点工作：\n\n- 实现了一个高效的元数据(dll)解析库\n- 改造了元数据管理模块，实现了元数据的动态注册\n- 实现了一个IL指令集到自定义的寄存器指令集的compiler\n- 实现了一个高效的寄存器解释器\n- 额外提供大量的instinct函数，提升解释器性能\n\n## 稳定性状况\n\nHybridCLR已经被广泛验证是非常高效、稳定的Unity热更新解决方案，良好满足大中型商业项目的稳定和性能要求。\n\n目前已经有数千个商业游戏项目接入了HybridCLR，其中有超过千个已经在App Store和Google Player上线，仅仅iOS免费榜前500名中就有近百款使用了HybridCLR。上线的项目中包括MMORPG、重度卡牌、重度塔防之类的游戏。国内绝大多数**Top游戏公司**都已经在使用HybridCLR。\n\n可查看我们已知的头部公司中使用HybridCLR并且已经上线的[项目列表](https://hybridclr.doc.code-philosophy.com/docs/other/businesscase)。\n\n## 支持与联系\n\n- 官方1群（3000人）：651188171（满）\n- 新手1群（3000人）：428404198（满）\n- 新手2群（2000人）：680274677（满）\n- 新手3群（2000人）：**920714552（推荐）**\n- discord频道 https://discord.gg/BATfNfJnm2\n- 商业合作邮箱: business#code-philosophy.com\n- [商业化支持](https://hybridclr.doc.code-philosophy.com/docs/business/intro)\n\n## 关于作者\n\n**walon** ：**Code Philosophy（代码哲学）** 创始人\n\n毕业于清华大学物理系，2006年CMO金牌，奥数国家集训队成员，保送清华基科班。专注于游戏技术，擅长开发架构和基础技术设施。\n\n## license\n\nHybridCLR is licensed under the [MIT](https://github.com/focus-creative-games/hybridclr/blob/main/LICENSE) license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-creative-games%2Fhybridclr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffocus-creative-games%2Fhybridclr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-creative-games%2Fhybridclr/lists"}