当前位置:网站首页>Unity Huatuo hot update environment installation and sample project
Unity Huatuo hot update environment installation and sample project
2022-07-27 02:04:00 【Clank's game stack】
In the last section we analyzed huatuo Principle and advantages of , I believe you can't wait to experience huatuo Hot update , In this section, we will install huatuo Development environment of , Then run the sample project , To experience huatuo Make a hot update .
Here is a Game development communication group You can learn and communicate together
huatuo Hot development environment installation
Use huatuo Before , Let's prepare the development environment first ,Unity edition , Official huatuo The version uses unity 2020.3.33f1 This version of , It is suggested that you also use this version . Install well visual studio 2019 development environment , And install C/C++ A collection of development tools . install Unity When , We must check Windows IL2CPP, It's convenient for us to wait Windows On platform testing . Next download huatuo Related codes , huatuo It is mainly the transformation IL2CPP, So the dependent code base is as follows :
- huatuo The core code base , Responsible for instruction conversion , Explain to perform , Source download
- IL2CPP_huatuo: huatuo in the light of IL2CPP Modification and modification of , Source download
- huatuo-tutorial: huatuo Hot update example project , Source download ;
When the download is complete , You will receive 3 Source package , As shown in the figure 1.2-1:

chart 1.2-1
decompression huatuo Source code package of the project , decompression il2cpp_huatuo Project source code package . After decompressing , take huatuo Project subfolders ”huatuo”, Copied to the il2cpp_huatuo Project libil2cpp Under the table of contents . Pictured 1.2-2 Shown :

chart 1.2-2
Get ready libil2cpp Of huatuo After environment , Let's put this folder ”libil2cpp” copy to Unity Engine IL2CPP In the corresponding directory , Before copying , Remember to back up the original . Pictured 1.2-3,Unity Editor 2020.3.33 il2cpp Medium libil2cpp.

chart 1.2-3
Here we are huatuo The development environment is ready .
function huatuo Hot example project
Huatuo After the development environment is installed , Next, we can run the instance project , The example project is very simple , We unzip the code package huatuo_trial, Unpack and use Unity 2020.3.33 Open this project , The directory structure of the project is shown in the figure 1.2-4:

chart 1.2-4

chart 1.2-5
Enter folder ”HuatuoData” after , function init_local_il2cpp_data Script , And that creates Localil2cppData Folder .

chart 1.2-6
Next we use Unity open huatuo Examples of projects , When testing hot updates , First configure the basic configuration of the project ( Of course, the sample project has been configured , But we should pay attention to our own projects ) Pictured 1.2-7.

chart 1.2-7
because huatuo Is based on IL2CPP To extend interpretation execution IL Of .dll. At this time, we need to split some parts that may be hotter , Use here unity Of ADF Mechanism , For every one created .asmdef file ,Unity Will generate a new one for you .net Project engineering , The benefits of this can be divided into functions to make the code hotter ( Such as the hall + Sub game , Each sub game can be divided into corresponding .dll), At the same time, compile by function , Not to modify the function A Your code requires all projects to be compiled , As a result, the later development is slower and slower .

chart 1.2-8
In this way, we have divided the project into several projects by function , Then you can package out each project based on IL Of .dll library . In this way, we can aim at the hotter .dll To load .
When we officially started the project , You can put these .dll utilize AOT Compile together , If you want to heat up a library , First determine whether there is the latest .dll, If so, you can load this at runtime , If not, run the default AOT The later code is ok ( Get better AOT Level of performance , After all, explain and implement IL Instructions , Performance also has overhead ).
Next, let's try the hot update , The example project extends a menu , You can package all projects IL Instruction code .dll, This menu expands to ”Huatuo”---> “CompileDall”, In this way, we can put all the current projects .dll Type it all out , Whether you are hot or not . Generated IL Of .dll after , If we put these .dll Package into resource package , Deploy to server , Load from the resource package IL Code to IL2CPP VM You can achieve hotter , So there is another menu ”Huatuo”---> “BuildBundles”, They will .dll play ab package .( Here is an example , It's not mandatory , Different projects can be customized by yourself , I'll teach myself the strategy when making the framework later , In this case .dll Pack to common ab In bag , Let's see common ab Bag mainifest.)

chart 1.2-9
Next, test the hot update , Compile the complete .dll And packaging ab After package , We released a win We add it 1.0,build After you come out , Run the following :

chart 1.2-10
Printed in the first edition , Yes ######, Next I'll remove this ######, Then recompile , pack Hotfix.dll New arrival common ab package , And directly copy common ab Package to the packed StreammingAssets Next , Pictured :




chart 1.2-10

Today's sharing is here , Pay attention to our , We will continue to update next huatuo Hotter series of tutorials .
Notice of next section : huatuo Hot example project source code analysis
边栏推荐
- Notes during in-depth learning (to be improved)
- 高度塌陷解决方法
- 行,表,页,共享,排他,悲观,乐观,死锁
- Electron FAQ 61 - must the client run with administrator privileges?
- 2022年T2I文本生成图像 中文期刊论文速览-1(ECAGAN:基于通道注意力机制的文本生成图像方法+CAE-GAN:基于Transformer交叉注意力的文本生成图像技术)
- js求最大值?
- Shell course summary
- 解决方案:炼丹师养成计划 Pytorch+DeepLearning遇见的各种报错与踩坑避坑记录(一)
- MySQL stored procedure function
- 24ssh service
猜你喜欢
随机推荐
Flink1.13.6详细部署方式
MySQL单表查询练习
QoS quality of service - QoS overview
Virtualization technology KVM
HarmonyOS图像处理应用开发实战直播笔记
三种能有效融合文本和图像信息的方法——特征拼接、跨模态注意、条件批量归一化
Removal and addition of reference types in template and generic programming
2022年最新文本生成图像研究 开源工作速览(Papers with code)
Makefile
Introduction to network - Introduction to home networking & basic network knowledge
D - Difference HDU - 5936
Use ECs and OSS to set up personal network disk
21dns domain name resolution
MySQL主从复制与读写分离
a元素的伪类
Machine learning exercise 7 - K-means and PCA (principal component analysis)
索引失效原理讲解及其常见情况
(atcoder contest 144) f - fork in the road (probability DP)
Which securities company is better or safer for retail investors to open accounts
[untitled]


![[untitled]](/img/2a/53327cd39db7871fa780ed599420d0.png)






