当前位置:网站首页>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
边栏推荐
- MySQL single table query exercise
- Use ECs and OSS to set up personal network disk
- Text to image论文精读SSA-GAN:基于语义空间感知的文本图像生成 Text to Image Generation with Semantic-Spatial Aware GAN
- a元素的伪类
- DF-GAN实验复现——复现DFGAN详细步骤 及使用MobaXtem实现远程端口到本机端口的转发查看Tensorboard
- ERROR! MySQL is not running, but PID file exists
- Application of load balancing
- MySQL单表查询练习
- ViTGAN:用视觉Transformer训练生成性对抗网络 Training GANs with Vision Transformers
- mysql视图
猜你喜欢
随机推荐
--Project summary
MySQL stored procedure function
Docker高级篇之Mysql主从复制、Redis集群扩容缩容配置案例详解
Project | implement a high concurrency memory pool
When El table is selected, the jump page remains selected
Use of GDB
Fastjson handles string escape characters
left join 、inner join 、right join区别
Shell programming specifications and variables
Text to image论文精读DF-GAN:A Simple and Effective Baseline for Text-to-Image Synthesis一种简单有效的文本生成图像基准模型
[cann training camp] enter media data processing 1
MySQL backup recovery
Specify that SQL only supports select syntax
解决方案:Win10如何使用bash批处理命令
mysql存储引擎及其区别
虚拟化技术KVM
shell课程总结
[translation] explicit and implicit batch in tensorrt
Share 29 chrome plug-ins, and there is always one for you
超出隐藏显示省略号









