Unity's epoch-making hot update solution YooAsset+HybridCLR (wolong) (formerly huatuo) (3)

In the previous article, we explained the installation using HybridCLR and how to hot-update the code. What should we do if we want to add hot-updates to resources? Some people can’t help but talk about installing ab packages. Indeed, under normal circumstances, you can only install them through the ab package. The ab package method is used to solve the hot update of resources.
  AssetBundle is the resource management method recommended by Unity. The official list lists the advantages such as hot update, compression, flexibility, etc. However, the pit of AssetBundle is very deep, and there are many hidden details that make it difficult for you to use it. Be careful, you may fall into a deep pit if you are not careful. If the packaging is not planned well, the 20MB resource will be "compressed" to 30MB, or a large number of packages will cause various inefficiencies during packaging and loading, or the association will be lost inexplicably, or the memory will explode. dropped, and various loading failures occurred. You will encounter all kinds of weird problems, and the AB package that YooAsset integrates and manages for you does not require you to manage and operate it yourself, which is more convenient.

What is YooAsset

YooAsset is an asset management system for Unity3D that helps the development team quickly deploy and deliver games.
It can meet the various needs of commercial games and has been verified by multiple million-DAU game products.

introduce

  • I want to release an installation package that does not contain any game resources, and then players can download it while playing.
  • I want to release an installation package that can guarantee the early experience, and then players can choose to download the level content.
  • I want to release an installation package with content under 300MB, and then download the remaining content before entering the game.
  • I want to release a stand-alone game installation package that supports normal updates when the network is open. Supports playing old versions when there is no network.
  • I want to release a MOD game installation package. Players can upload their own MOD content to the server, and other players can download and play it.
  • We are working on a very large project with hundreds of GB of resource content. Each build takes a lot of time. Can we build it in separate projects?

System Features

  • Seamlessly switch between build pipelines
    • Supports traditional built-in build pipelines and programmable build pipelines (SBP).
  • Support distributed builds
    • It supports the construction of separate projects and the construction of content within the project. It is very convenient to support game modules (MOD).
  • Support addressable resource location
    • By default, resource positioning of complete paths is supported, and addressable resource positioning is also supported. Addressing paths can be configured efficiently without cumbersome processes.
  • Safe and efficient subcontracting solution
    • A subcontracting solution based on resource tags automatically classifies dependent resource packages to avoid manual maintenance costs. It is very convenient to implement zero resource installation package or full resource installation package.
  • Powerful and flexible packaging system
    • You can customize packaging strategies and automatically analyze dependencies to achieve zero resource redundancy. The resource package dependency management solution based on resource objects naturally avoids the problem of circular dependencies between resource packages.
  • Based on reference counting scheme
    • Management solutions based on reference counting can help us implement safe resource offloading strategies, better memory management, and avoid resource object redundancy. There are also powerful analyzers to help uncover potential resource leaks.
  • Free switching between multiple modes
    • Editor simulation mode, stand-alone running mode, online running mode. In the editor simulation mode, you can simulate the real environment without building resource packages, and you can freely switch to other modes without modifying any code.
  • Powerful and secure loading system
    • Asynchronous loading supports multiple asynchronous loading methods such as coroutines, tasks, and delegates.
    • Synchronous loading supports mixed use of synchronous loading and asynchronous loading.
    • Download while playing. When loading a resource object, if the resource package that the resource object depends on does not exist locally, it will be automatically downloaded from the server to the local computer, and then the resource object will be loaded.
    • Multi-threaded downloading supports breakpoint resumption, automatically verifies downloaded files, and automatically repairs damaged files.
    • Multifunctional downloader You can create downloaders according to resource classification tags or according to resource objects. You can set a limit on the number of files downloaded at the same time, set the number of retries for failed downloads, and set the download timeout time. When multiple downloaders download at the same time, you don’t have to worry about repeated file downloads. The downloader also provides common interfaces such as download progress and download failure.
  • Native format file management
    Seamlessly connects the resource packaging system, which can easily realize the version management and download of native files.
  • Flexible version management
    Supports quick rollback of online versions, supports differentiation of audit versions, test versions, and online versions, and supports grayscale updates and testing.

The above are the advantages of YooAsset at this stage.

Install YooAsset

Open the previous installation HybridCLR project and install YooAsset.

1. Install through PackageManager

Open the management interface Edit/Project Settings/Package Manager
Enter the following content:

(中国版)
Name: package.openupm.cn
URL: https://package.openupm.cn
Scope(s): com.tuyoogame.yooasset

(国际版)
Name: package.openupm.com
URL: https://package.openupm.com
Scope(s): com.tuyoogame.yooasset

Then click thesave button to start the installation.
Insert image description here
Open the management interface Edit/Windows/Package Manager
Packages selection My Registries, YooAsset appears, click Install Install.
Insert image description here
Let’s go back to the Package Manager interface just now. There is a Samples example under YooAesset and a Space Shooter sample project. Click < /span>Import button to import into the project.
Insert image description here

 { “dependencies”: {   “com.tuyoogame.yooasset”: “0.0.1-preview”,   },  “scopedRegistries”: [  {   “name”: “package.openupm.cn”,   “url”: “https://package.openupm.cn”,   “scopes”: [     “com.tuyoogame.yooasset”    ]   }  ] }















3. Download and install through Github
In the released Release version, select the latest version to download the Source Code compressed package.

The first method is recommended here for ease of learning.

system requirement

Supported versions: Unity2019.4 & Unity2020.3 & Unity2021.3 & Unity2022.3

Supported platforms: Windows, OSX, Android, iOS, WebGL

Development environment: .NET4.x

Directory Structure

Assets
└─ YooAsset
├─ Editor editor source code directory
├─ Runtime runtime source code directory
├─ LICENSE Copyright Document
└─ README Documentation

At this point, the YooAsset installation is complete.

The functions and uses of YooAssets will be introduced in detail in the next article

Guess you like

Origin blog.csdn.net/weixin_43298513/article/details/132409248