Huatuo热更新--安装HybridCLR

发布于:2025-02-15 ⋅ 阅读:(29) ⋅ 点赞:(0)

1.自行安装unity编辑器

支持2019.4.x、2020.3.x、2021.3.x、2022.3.x 中任一版本。推荐安装2019.4.40、2020.3.26+、2021.3.x、2022.3.x版本。

根据你打包的目标平台,安装过程中选择必要模块。如果打包Android或iOS,直接选择相应模块即可。如果你想打包Standalone,必须额外选中 Windows Build Support(IL2CPP)Mac Build Support(IL2CPP)

2.安装com.code-philosophy.hybridclr package包

方法1:从git仓库安装

打开unity-Window- Package Manager

填入https://gitee.com/focus-creative-games/hybridclr_unity.git

https://github.com/focus-creative-games/hybridclr_unity.git

  • main分支地址为 https://gitee.com/focus-creative-games/hybridclr_unity.git
  • 其他tag版本地址为 https://gitee.com/focus-creative-games/hybridclr_unity.git#{tag}

想安装某个分支或者tag版本,请在地址后加上#{tag},如 https://gitee.com/focus-creative-games/hybridclr_unity.git#v3.0.1

若安装不成功可用方法2

方法2:本地安装

手动下载上述git地址工程然后解压,同样在Window- Package Manager选择Add package from disk,然后选择解压文件中的package.json即可安装

3.Install HybridCLR

安装号HybridCLR的package包后就可以正式安装HybridCLR了,选择unity顶部编辑栏的HybridCLR-Installer,然后点击Install即可

若安装失败则需要安装Git工具(bug信息内有地址),安装完git后再次Install即可。

除了使用git安装外,官方还支持本地安装,但实测很麻烦,而且容易版本不对,导致后续打包等出错,所以推荐直接使用git安装 。

至此,安装彻底完成。

4.简单配置

安装完成后,需要做个简单配置,打开Edit-Project Settings,在Player-Other Settings中找到如下图内容并修改

 某些高版本unity Api Compatibility Level没有.NET 4.x,可以选择.NET framework。