当前位置:网站首页>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
边栏推荐
猜你喜欢
![[cann training camp] enter media data processing 1](/img/6c/76d3784203af18a7dee199c3a7fd24.png)
[cann training camp] enter media data processing 1

利用九天深度学习平台复现SSA-GAN

Shell (8) cycle

Freytek central computing platform 360 degree sensing system solves the challenges behind NOA mass production

Hands on experiment of network and VPC

MySQL主从复制与读写分离

MVCC及其原理详解

Shell programming specifications and variables

MySQL view

【无标题】
随机推荐
MySQL备份恢复
Introduction to network - Introduction to home networking & basic network knowledge
Machine learning exercise 7 - K-means and PCA (principal component analysis)
解决方案:炼丹师养成计划 Pytorch+DeepLearning遇见的各种报错与踩坑避坑记录(二)
Machine learning exercise 6 - Support Vector Machines
Flink1.13.6详细部署方式
D - Difference HDU - 5936
Connect mysql detailed graphic operations in ECs docker (all)
Hands on experiment of network and VPC
Notes during in-depth learning (to be improved)
[daily question] 565. Array nesting
Mysql database - interview questions
Ubuntu12.10 installing mysql5.5 (I)
三种能有效融合文本和图像信息的方法——特征拼接、跨模态注意、条件批量归一化
机器学习概述
Text to image论文精读SSA-GAN:基于语义空间感知的文本图像生成 Text to Image Generation with Semantic-Spatial Aware GAN
Realize data interaction between two apps through fileprovider
ERROR! MySQL is not running, but PID file exists
Text to image论文精读DF-GAN:A Simple and Effective Baseline for Text-to-Image Synthesis一种简单有效的文本生成图像基准模型
负载均衡的运用