最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Unity_Addressable_Remote content distribution(遠(yuǎn)程內(nèi)容分發(fā))

2023-04-06 10:38 作者:unity_某某師_高錦錦  | 我要投稿

Distributing content remotely can reduce initial app download size and install time. You can also update remotely distributed assets without republishing your app or game

譯:遠(yuǎn)程分發(fā)內(nèi)容可以減少初始應(yīng)用程序下載大小和安裝時間。您還可以更新遠(yuǎn)程分發(fā)的資產(chǎn),而無需重新發(fā)布您的應(yīng)用或游戲

When you assign a remote URL as the Load Path of a group, the Addressables system loads assets in the group from that URL. When you enable the Build Remote Catalog option, Addressables looks up the addresses of any remote assets in the remote catalog, allowing you to make changes to Addressable assets without forcing users to update and reinstall the entire game or application.

譯:當(dāng)您將遠(yuǎn)程 URL 指定為組的加載路徑時,Addressables 系統(tǒng)會從該 URL 加載組中的資產(chǎn)。當(dāng)您啟用構(gòu)建遠(yuǎn)程目錄選項(xiàng)時,Addressables 會在遠(yuǎn)程目錄中查找任何遠(yuǎn)程資產(chǎn)的地址,從而允許您對可尋址資產(chǎn)進(jìn)行更改,而無需強(qiáng)制用戶更新和重新安裝整個游戲或應(yīng)用程序

After?enabling remote distribution, you can build your content in two ways:

譯:啟用遠(yuǎn)程分發(fā)后,您可以通過兩種方式構(gòu)建您的內(nèi)容

  • A full?content build?using the?New Build > Default Build Script: builds all content bundles and catalogs. Always perform a full build before rebuilding your player when preparing to publish or update your full application.譯:使用New Build > Default Build Script 的完整內(nèi)容構(gòu)建:構(gòu)建所有內(nèi)容包和目錄。在準(zhǔn)備發(fā)布或更新完整應(yīng)用程序時,請始終在重建播放器之前執(zhí)行完整構(gòu)建

  • A?content update build?using the?Update a Previous Build?script: builds all content bundles and catalogs, but sets up the remote catalog so that installed applications only need to download the changed bundles. Run the?Check for Content Update Restrictions?tool to identify changes and prepare your groups before building an update.譯:使用Update a Previous Build腳本的內(nèi)容更新構(gòu)建:構(gòu)建所有內(nèi)容包和目錄,但設(shè)置遠(yuǎn)程目錄以便已安裝的應(yīng)用程序只需要下載更改的包。運(yùn)行檢查內(nèi)容更新限制工具以識別更改并在構(gòu)建更新之前準(zhǔn)備您的組

After building a full build or an update, you must upload your remote catalog, catalog hash file, and remote bundles to your hosting service.

譯:構(gòu)建完整構(gòu)建或更新后,您必須將遠(yuǎn)程目錄、目錄哈希文件和遠(yuǎn)程包上傳到托管服務(wù)

See?Using Profiles to aid development?for tips on setting up Addressables Profiles to help you develop, test, and publish remote content.

譯:有關(guān)設(shè)置可尋址配置文件以幫助您開發(fā)、測試和發(fā)布遠(yuǎn)程內(nèi)容的提示,請參閱使用配置文件來幫助開發(fā)


Enabling remote distribution

To enable remote distribution of your content, you must enable the remote catalog and set up the groups containing the assets you want to host remotely.

譯:要啟用內(nèi)容的遠(yuǎn)程分發(fā),您必須啟用遠(yuǎn)程目錄并設(shè)置包含您要遠(yuǎn)程托管的資產(chǎn)的組

Enabling the remote catalog

Enable the remote catalog in your?Addressable Asset Settings?Inspector (menu:?Window > Asset Management > Addressables > Settings).

譯:在可尋址資產(chǎn)設(shè)置檢查器中啟用遠(yuǎn)程目錄(菜單:Window > Asset Management > Addressables > Settings

  • Build Remote Catalog: enabled譯:構(gòu)建遠(yuǎn)程目錄:已啟用

  • Build & Load Paths: Remote譯:構(gòu)建和加載路徑:遠(yuǎn)程

啟用遠(yuǎn)程目錄

The catalog and its accompanying hash file are built to the folder specified by the?Build Path?setting. You must upload these files so that they can be accessed at the URL specified by your?Load Path?setting. Unless you have a specific reason not to, use the?Remote?location so that the catalog is built to and loaded from the same paths as your remote bundles.

譯:目錄及其隨附的哈希文件構(gòu)建到構(gòu)建路徑設(shè)置指定的文件夾中。您必須上傳這些文件,以便可以通過加載路徑設(shè)置指定的 URL 訪問它們。除非您有特殊原因不這樣做,否則請使用遠(yuǎn)程位置,以便將目錄構(gòu)建到與遠(yuǎn)程包相同的路徑并從中加載

Setting up a remote group

To set up a group so that the assets in it can be hosted remotely, set the?Build & Load Paths?using the?Remote?location:

譯:要設(shè)置一個組以便可以遠(yuǎn)程托管其中的資產(chǎn),請使用遠(yuǎn)程位置設(shè)置構(gòu)建和加載路徑

If you plan to publish content updates between publishing full rebuilds of your application, set the?Update Restriction?value according to how often you expect to update content in a group.

譯:如果您計(jì)劃在發(fā)布應(yīng)用程序的完整重建之間發(fā)布內(nèi)容更新,請根據(jù)您希望在組中更新內(nèi)容的頻率設(shè)置更新限制值

Choose?Cannot Change Post Release?for groups that produce larger bundles, especially if you do not anticipate changing most of the assets in the group. If you do change assets in a group with this setting, the Addressables tools move the changed assets to a new group for the update. Only the new bundles are downloaded by installed applications.

譯:為生成較大捆綁包的組選擇無法更改發(fā)布后版本,尤其是當(dāng)您預(yù)計(jì)不會更改組中的大部分資產(chǎn)時。如果您使用此設(shè)置更改組中的資產(chǎn),Addressables 工具會將更改的資產(chǎn)移動到新組以進(jìn)行更新。已安裝的應(yīng)用程序只會下載新的捆綁包

Choose?Can Change Post Release?for groups containing assets that you expect to change frequently. If you change assets in a group with this setting, the bundles containing those assets are rebuilt as a whole and will be redownloaded by installed applications. To reduce the amount of data that needs to be downloaded after an update, try to keep the bundles produced by groups with this setting as small as possible.

譯:為包含您希望經(jīng)常更改的資產(chǎn)的組選擇可以更改發(fā)布后。如果您使用此設(shè)置更改組中的資產(chǎn),則包含這些資產(chǎn)的包將作為一個整體重建,并將由已安裝的應(yīng)用程序重新下載。要減少更新后需要下載的數(shù)據(jù)量,請嘗試使使用此設(shè)置的組生成的捆綁包盡可能小

See?Content update builds?for more information about updating remote content.

譯:有關(guān)更新遠(yuǎn)程內(nèi)容的更多信息,請參閱內(nèi)容更新構(gòu)建

The?Advanced Options?section contains some options that affect remote hosting and downloads (but aren't necessary to enable remote hosting). See?Advanced Options?for more information.

譯:高級選項(xiàng)部分包含一些影響遠(yuǎn)程托管和下載的選項(xiàng)(但不是啟用遠(yuǎn)程托管所必需的)。有關(guān)詳細(xì)信息,請參閱高級選項(xiàng)

Using Profiles to aid development

A?Profile?defines variables that you can use to set the build and load paths for both your local and remote content.

譯:配置文件定義可用于設(shè)置本地和遠(yuǎn)程內(nèi)容的構(gòu)建和加載路徑的變量

When you distribute content remotely, you typically need to set different URLS (load paths) for your remote content depending on why you are making a build. Some examples of such situations include:

譯:遠(yuǎn)程分發(fā)內(nèi)容時,通常需要根據(jù)構(gòu)建的原因?yàn)檫h(yuǎn)程內(nèi)容設(shè)置不同的 URLS(加載路徑)。這種情況的一些例子包括

Builds for testing general game play and function

譯:用于測試一般游戲玩法和功能的構(gòu)建

Early in development or when you need to test without access to a host, you might find it convenient to treat all your content as local content. For this situation set the?Local?and?Remote?profile variables using the?Built-In?location.

譯:在開發(fā)初期或需要在無法訪問主機(jī)的情況下進(jìn)行測試時,您可能會發(fā)現(xiàn)將所有內(nèi)容視為本地內(nèi)容很方便。對于這種情況,使用內(nèi)置位置設(shè)置本地遠(yuǎn)程配置文件變量

All content treated as local_所有內(nèi)容均視為本地內(nèi)容

Builds for local hosting

Later, when you set up a host on your local network (or localhost), you will need to change the Load Path for your remote groups to reflect the URL of the host. For example if using?Editor Hosting, set the?Remote?profile variable using the?Editor Hosting?location.

譯:稍后,當(dāng)您在本地網(wǎng)絡(luò)(或本地主機(jī))上設(shè)置主機(jī)時,您需要更改遠(yuǎn)程組的加載路徑以反映主機(jī)的 URL。例如,如果使用編輯器托管,請使用編輯器托管位置設(shè)置遠(yuǎn)程配置文件變量

?Remote content served from Editor Hosting_從 Editor Hosting 提供的遠(yuǎn)程內(nèi)容

Builds for CDN

As you get closer to production, you might use a staging server and then, your production Content Delivery Network (CDN). For example if using?Cloud Content Delivery, set the?Remote?profile variable using the?Cloud Content Delivery?location.

譯:當(dāng)您接近生產(chǎn)時,您可能會使用暫存服務(wù)器,然后使用您的生產(chǎn)內(nèi)容交付網(wǎng)絡(luò) (CDN)。例如,如果使用Cloud Content Delivery,請使用Cloud Content Delivery位置設(shè)置遠(yuǎn)程配置文件變量

Remote content hosted on the Unity Cloud Content Delivery service

Other

Even after release, you might want to use different host URLs for beta testing or other purposes.

譯:即使在發(fā)布之后,您也可能希望使用不同的主機(jī) URL 進(jìn)行 Beta 測試或其他目的。

Rather than hand configuring the build and load paths every time you build, you can create a different Profile and set the variables appropriately. Then, you can easily switch between Profiles before making a content build without worrying about misconfiguring the paths.

譯:您不必在每次構(gòu)建時手動配置構(gòu)建和加載路徑,您可以創(chuàng)建一個不同的配置文件并適當(dāng)?shù)卦O(shè)置變量。然后,您可以在構(gòu)建內(nèi)容之前輕松地在配置文件之間切換,而不必?fù)?dān)心路徑配置錯誤

If you use a script to launch your content builds, then you can use the Addressables API to choose a specific Profile for a build. See?Starting an Addressables build from a script.

譯:如果您使用腳本來啟動您的內(nèi)容構(gòu)建,那么您可以使用 Addressables API 為構(gòu)建選擇特定的配置文件。請參閱從腳本啟動 Addressables 構(gòu)建。

If you have complex URLs, you can reference static fields or properties in your Profile variables that are evaluated at build- or runtime. For example, rather than entering your CCD ProjectID as a string, you could create an Editor class that provides the information as a static property and reference it as, [CCDInfo.ProjectID]. See?Profile variable syntax?for more information. (InternalIdTransformFunc?functions provide an additional method of handling complex URL requirements.)

譯:如果您有復(fù)雜的 URL,您可以在您的 Profile 變量中引用在構(gòu)建或運(yùn)行時評估的靜態(tài)字段或?qū)傩浴@?,與其以字符串形式輸入 CCD ProjectID,不如創(chuàng)建一個 Editor 類,以靜態(tài)屬性形式提供信息并將其引用為 [CCDInfo.ProjectID]。有關(guān)詳細(xì)信息,請參閱配置文件變量語法。(InternalIdTransformFunc函數(shù)提供了一種處理復(fù)雜 URL 要求的附加方法。)

NOTE

If your remote URL requires cannot be expressed as a static string see?Custom URL evaluation?for information about how you can rewrite the URL for assets, including AssetBundles, at runtime.

譯:如果您的遠(yuǎn)程 URL 要求不能表示為靜態(tài)字符串,請參閱自定義 URL 評估,了解有關(guān)如何在運(yùn)行時重寫資產(chǎn)(包括 AssetBundle)的 URL 的信息

AssetBundle caching

By default, AssetBundles produced for an Addressables build are cached on the client device after they are downloaded. Cached bundles are only downloaded again if they are updated or if they are deleted from the cache.

譯:默認(rèn)情況下,為 Addressables 構(gòu)建生成的 AssetBundle 在下載后緩存在客戶端設(shè)備上。緩存的捆綁包只有在更新或從緩存中刪除時才會再次下載

An updated catalog can exclude bundle entries present in an older version of the catalog. When these entries are cached, their data is no longer needed on the device.

譯:更新的目錄可以排除舊版本目錄中存在的包條目。當(dāng)這些條目被緩存時,設(shè)備上不再需要它們的數(shù)據(jù)

When you have unneeded cache data on the device, you can choose one of three options:

譯:當(dāng)設(shè)備上有不需要的緩存數(shù)據(jù)時,您可以選擇以下三個選項(xiàng)之一

  • To delete the entire bundle cache, use?Caching.ClearCache.譯:要刪除整個包緩存,請使用Caching.ClearCache

  • To remove cache entries that are no longer referenced at any time, use?Addressables.CleanBundleCache. You usually call this function after initializing Addressables (see?Customizing Addressables initialization) or after loading additional catalogs (see?Managing catalogs at runtime).譯:要隨時刪除不再引用的緩存條目,請使用Addressables.CleanBundleCache。您通常在初始化 Addressables(請參閱自定義 Addressables 初始化)或加載其他目錄(請參閱在運(yùn)行時管理目錄)之后調(diào)用此函數(shù)

  • To automatically call?Addressables.CleanBundleCache?after updating catalogs, use the parameter?autoCleanBundleCache?in?Addressables.UpdateCatalogs. See?Checking for content updates at runtime?for an example script.譯:

  • 要在更新目錄后自動調(diào)用Addressables.CleanBundleCache ,請使用Addressables.UpdateCatalogsautoCleanBundleCache中的參數(shù)。有關(guān)示例腳本,請參閱在運(yùn)行時檢查內(nèi)容更新。

If you disable caching for a group, the remote bundles produced for the group are stored in memory when they are downloaded until you unload them or the application exits. The next time the application loads the bundle, Addressables downloads it again.

譯:如果您禁用組的緩存,則為該組生成的遠(yuǎn)程包在下載時將存儲在內(nèi)存中,直到您卸載它們或應(yīng)用程序退出。下次應(yīng)用程序加載包時,Addressables 會再次下載它

You can control whether the bundles produced by a group are cached or not with the?Use Asset Bundle Cache?setting under?Advanced Options?in the Group Inspector.

譯:您可以使用組檢查器中高級選項(xiàng)下的使用資產(chǎn)包緩存設(shè)置來控制組生成的包是否被緩存

See?AssetBundle compression?for additional information about AssetBundle caching. The Addressables system sets the cache-related parameters of the?UnityWebRequests?it uses to download Addressable bundles based on the group settings.

譯:有關(guān) AssetBundle 緩存的更多信息,請參閱AssetBundle 壓縮。Addressables 系統(tǒng)設(shè)置UnityWebRequests的緩存相關(guān)參數(shù),它用于根據(jù)組設(shè)置下載 Addressable bundle

Note that there are some limitations for WebGL AssetBundles. For more information, see?Building and running a WebGL project.

譯:請注意,WebGL AssetBundle 有一些限制。有關(guān)詳細(xì)信息,請參閱構(gòu)建和運(yùn)行 WebGL 項(xiàng)目

Pre-downloading remote content

In situations where you want to predownload content so that it is cached on disk and faster to access when the application needs it, you can use the?Addressables.DownloadDependenciesAsync?method. This method downloads an Addressable entity and any dependencies as a background task.

譯:在您想要預(yù)下載內(nèi)容以便將其緩存在磁盤上并在應(yīng)用程序需要時更快地訪問的情況下,您可以使用 Addressables.DownloadDependenciesAsync方法。此方法下載 Addressable 實(shí)體和任何依賴項(xiàng)作為后臺任務(wù)。

Calling the?Addressables.DownloadDependenciesAsync?method loads the dependencies for the address or label that you pass in. Typically, this is the AssetBundle.

譯:調(diào)用Addressables.DownloadDependenciesAsync方法加載您傳入的地址或標(biāo)簽的依賴項(xiàng)。通常,這是 AssetBundle。

The?AsyncOperationHandle?struct returned by this call includes a PercentComplete attribute that you can use to monitor and display download progress. You can also have the app wait until the content has loaded.

譯:此調(diào)用返回的AsyncOperationHandle結(jié)構(gòu)包括可用于監(jiān)視和顯示下載進(jìn)度的 PercentComplete 屬性。您還可以讓應(yīng)用程序等待內(nèi)容加載完畢

Regarding PercentComplete

PercentComplete takes into account several aspects of the underlying operations being handled by a single AsyncOperationHandle. There may be instances where the progression isn't linear, or some semblance of linear. This can be due to quick operations being weighted the same as operations that will take longer.

譯:PercentComplete 考慮了由單個 AsyncOperationHandle 處理的基礎(chǔ)操作的幾個方面。在某些情況下,進(jìn)展可能不是線性的,或者是線性的。這可能是由于快速操作與需要更長時間的操作的權(quán)重相同

For example, given an asset you wish to load from a remote location that takes a non-trivial amount of time to download and is reliant on a local bundle as a dependency you'll see your PercentComplete jump to 50% before continuing. This is because the local bundle is able to be loaded much quicker than the remote bundle. However, all the system is aware of is the need for two operations to be complete.

譯:例如,給定您希望從遠(yuǎn)程位置加載的資產(chǎn),該資產(chǎn)需要花費(fèi)大量時間來下載并且依賴于本地包作為依賴項(xiàng),您會看到 PercentComplete 跳到 50%,然后再繼續(xù)。這是因?yàn)楸镜匕募虞d速度比遠(yuǎn)程包快得多。但是,系統(tǒng)只知道需要完成兩個操

If you wish to ask the user for consent prior to download, use?Addressables.GetDownloadSize?to return how much space is needed to download the content from a given address or label. Note that this takes into account any previously downloaded bundles that are still in Unity's AssetBundle cache.

譯:如果您希望在下載之前征求用戶的同意,請使用Addressables.GetDownloadSize返回從給定地址或標(biāo)簽下載內(nèi)容需要多少空間。請注意,這會考慮仍在 Unity 的 AssetBundle 緩存中的所有先前下載的包。

While it can be advantageous to download assets for your app in advance, there are instances where you might choose not to do so. For example:

譯:雖然提前為您的應(yīng)用下載資產(chǎn)可能是有利的,但在某些情況下您可能選擇不這樣做。例如:

  • If your app has a large amount of online content, and you generally expect users to only ever interact with a portion of it.譯:如果您的應(yīng)用包含大量在線內(nèi)容,并且您通常希望用戶只與其中的一部分進(jìn)行交互

  • You have an app that must be connected online to function. If all your app's content is in small bundles, you might choose to download content as needed.譯:您有一個必須在線連接才能運(yùn)行的應(yīng)用程序。如果您應(yīng)用程序的所有內(nèi)容都打包成小包,您可以選擇根據(jù)需要下載內(nèi)容

Rather than using the percent complete value to wait until the content is loaded, you can use the preload functionality to show that the download has started, then continue on. This implementation would require a loading or waiting screen to handle instances where the asset has not finished loading by the time it's needed.

譯:您可以使用預(yù)加載功能來顯示下載已開始,然后繼續(xù),而不是使用完成百分比值等到內(nèi)容加載完畢。此實(shí)現(xiàn)需要一個加載或等待屏幕來處理資產(chǎn)在需要時尚未完成加載的情況

Custom URL evaluation

There are several scenarios where you might need to customize the path or URL of an Asset (an AssetBundle generally) at runtime. The most common example is creating signed URLs. Another is dynamic host determination.

譯:在多種情況下,您可能需要在運(yùn)行時自定義資產(chǎn)(通常是 AssetBundle)的路徑或 URL。最常見的示例是創(chuàng)建簽名 URL。另一個是動態(tài)主機(jī)確定


Unity_Addressable_Remote content distribution(遠(yuǎn)程內(nèi)容分發(fā))的評論 (共 條)

分享到微博請遵守國家法律
大宁县| 红河县| 平武县| 广东省| 汪清县| 普洱| 拉孜县| 桃园县| 新源县| 石城县| 张北县| 炉霍县| 郓城县| 文成县| 永州市| 揭西县| 通山县| 平阴县| 新昌县| 开原市| 滦平县| 福贡县| 锡林郭勒盟| 赤峰市| 准格尔旗| 连平县| 茶陵县| 大新县| 揭阳市| 新化县| 巴东县| 安平县| 辽阳县| 白河县| 秦皇岛市| 昌图县| 张家界市| 江油市| 晋城| 藁城市| 磐石市|