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

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

Unity_Addressable_在編輯器中管理Addressable

2023-03-30 10:13 作者:unity_某某師_高錦錦  | 我要投稿

While it's impossible to comprehensively catalog all the different ways you can organize the assets in your project,?Organizing Addressable assets?outlines several considerations to take into account when you plan your organizational strategy.

譯:雖然不可能對(duì)項(xiàng)目中組織資產(chǎn)的所有不同方式進(jìn)行全面編目,但組織可尋址資產(chǎn)概述了在規(guī)劃組織策略時(shí)需要考慮的幾個(gè)因素。

You should also understand?How Addressables interact with your Project assets?while you consider how to manage your assets.

譯:在考慮如何管理您的資產(chǎn)時(shí),您還應(yīng)該了解Addressables如何與您的項(xiàng)目資產(chǎn)交互。

Addressable?Groups?are the primary unit of organization with which you manage Addressable assets. An important consideration when using Addressables are your options for?Packing groups into AssetBundles.

譯:可尋址組是管理可尋址資產(chǎn)的主要組織單位。在使用Addressables時(shí),一個(gè)重要的考慮因素是將組打包到資產(chǎn)包中的選項(xiàng)。

In addition to your group settings, you can use the following to control how Addressables work in a project:

譯:除了組設(shè)置外,您還可以使用以下功能來(lái)控制可尋址對(duì)象在項(xiàng)目中的工作方式:

  • Addressable Asset Settings: the Project-level settings譯:Addressable Asset Settings 工程登記設(shè)置

  • Profiles: defines collections of build path settings that you can switch between depending on the purpose of a build. (Primarily of interest if you plan to distribute content remotely.)譯:Profiles定義構(gòu)建路徑設(shè)置的集合,您可以根據(jù)構(gòu)建的目的在這些設(shè)置之間進(jìn)行切換。(如果您計(jì)劃遠(yuǎn)程分發(fā)內(nèi)容,主要是感興趣的。)

  • Labels: edit the Addressable asset labels used in your project.譯:Labels:編輯項(xiàng)目中使用的可尋址資產(chǎn)標(biāo)簽。

  • Play Mode Scripts: choose how the Addressables system loads assets when you enter Play mode in the Editor.譯:Play Mode Scripts:當(dāng)你在編輯器中進(jìn)入播放模式時(shí),選擇Addressables系統(tǒng)如何加載資產(chǎn)。

AssetReferences?provide a UI-friendly way to use Addressable assets. You can include AssetReference fields in your MonoBehaviour and ScriptableObject classes and then assign assets to them in the Editor using drag-and-drop or the object picker dialog.

譯:資產(chǎn)引用提供了一種用戶(hù)界面友好的方式來(lái)使用可尋址資產(chǎn)。您可以在MonoBehaviour和ScriptableObject類(lèi)中包含AssetReference字段,然后在編輯器中使用拖放或?qū)ο筮x擇器對(duì)話(huà)框?qū)①Y產(chǎn)分配給它們。

The Addressables system provides the following additional tools to aid development:

譯:Addressables系統(tǒng)提供了以下額外的工具來(lái)幫助開(kāi)發(fā):

  • Analyze tool: provides various analysis rules that you can run to verify that you have organized your assets the way you want, including a report on how Addressables will package your assets into bundles.譯:Analyze tool:提供各種分析規(guī)則,您可以運(yùn)行這些規(guī)則來(lái)驗(yàn)證您已經(jīng)按照您想要的方式組織了您的資產(chǎn),包括一個(gè)關(guān)于Addressables如何將您的資產(chǎn)打包成包的報(bào)告。

  • Event viewer: provides a profile view that shows when your assets are loaded and released. Use the Event viewer to verify that you are releasing assets and to monitor peak memory use.譯:Event viewer:提供一個(gè)概要文件視圖,顯示何時(shí)加載和釋放資產(chǎn)。使用事件查看器來(lái)驗(yàn)證您正在釋放資產(chǎn)并監(jiān)視峰值內(nèi)存使用。

  • Hosting Service: provides a simple asset server that you can use to host remote assets for local development.譯:Hosting Service:提供一個(gè)簡(jiǎn)單的資產(chǎn)服務(wù)器,您可以使用它托管遠(yuǎn)程資產(chǎn)以進(jìn)行本地開(kāi)發(fā)。

  • Build layout report: provides a description of the AssetBundles produced by a build.譯:Build layout report:提供由構(gòu)建生成的資產(chǎn)包的描述

  • Build profile log: provides a log profiling the build process itself so that you can see which parts take the longest.譯:Build profile log:提供構(gòu)建過(guò)程本身的日志分析,以便您可以查看哪些部分花費(fèi)的時(shí)間最長(zhǎng)。

Organizing Addressable Assets

There’s no single best way to organize your assets; it depends on the specific requirements of each project. Aspects to consider when planning how to manage your assets in a project include:

譯:沒(méi)有唯一的最佳方式來(lái)組織你的資產(chǎn);這取決于每個(gè)項(xiàng)目的具體要求。在計(jì)劃如何管理項(xiàng)目中的資產(chǎn)時(shí),需要考慮的方面包括:

  • Logical organization: keeping assets in logical categories can make it easier to understand your organization and spot items that are out of place.譯:Logical organization:將資產(chǎn)保持在邏輯類(lèi)別中可以使您更容易理解您的組織并發(fā)現(xiàn)不合適的項(xiàng)目

  • Runtime performance: performance bottlenecks can occur if your bundles become very large, or alternatively if you have a very large number of bundles.譯:Runtime performance:?如果您的bundle變得非常大,或者您有非常多的bundle,就會(huì)出現(xiàn)性能瓶頸

  • Runtime memory management: keeping assets together that you use together can help lower peak memory requirements.譯:Runtime memory management:將一起使用的資產(chǎn)放在一起可以幫助降低峰值內(nèi)存需求。

  • Scale: some ways of organizing assets might work well in small games, but not large ones, and vice versa.譯:Scale:?一些組織資產(chǎn)的方法可能適合小型游戲,但不適用于大型游戲,反之亦然

  • Platform characteristics: the characteristics and requirements of a platform can be a large consideration in how to organize your assets. Some examples:譯:Platform characteristics在如何組織資產(chǎn)時(shí),平臺(tái)的特征和需求可能是一個(gè)很大的考慮因素。一些例子

    • Platforms that provide abundant virtual memory can handle large bundle sizes better than those with limited virtual memory.譯:與虛擬內(nèi)存有限的平臺(tái)相比,提供豐富虛擬內(nèi)存的平臺(tái)可以更好地處理大容量的包

    • Some platforms don't support downloading content, ruling out remote distribution of assets entirely.譯:有些平臺(tái)不支持下載內(nèi)容,完全排除了資產(chǎn)的遠(yuǎn)程分發(fā)

    • Some platforms don't support AssetBundle caching, so putting assets in local bundles, when possible, is more efficient.譯:有些平臺(tái)不支持AssetBundle緩存,因此盡可能將資產(chǎn)放在本地bundle中會(huì)更有效

  • Distribution: whether you distribute your content remotely or not means, at the very least, that you must separate your remote content from your local content.譯:Distribution:無(wú)論您是否遠(yuǎn)程分發(fā)您的內(nèi)容,至少意味著您必須將遠(yuǎn)程內(nèi)容與本地內(nèi)容分開(kāi)

  • How often assets are updated: keep assets that you expect to update frequently separate from those that you plan to rarely update.譯:資產(chǎn)更新的頻率:將您希望頻繁更新的資產(chǎn)與您計(jì)劃很少更新的資產(chǎn)分開(kāi)

  • Version control: the more people who work on the same assets and asset groups, the greater the chance for version control conflicts to occur in a project.譯:Version control:在相同資產(chǎn)和資產(chǎn)組上工作的人越多,項(xiàng)目中發(fā)生版本控制沖突的可能性就越大

Common strategies

Typical strategies include:

譯:典型策略包括:

  • Concurrent usage: group assets that you load at the same time together, such as all the assets for a given level. This strategy is often the most effective in the long term and can help reduce peak memory use in a project.譯:并發(fā)使用:將您同時(shí)加載的資產(chǎn)組合在一起,例如給定關(guān)卡的所有資產(chǎn)。從長(zhǎng)期來(lái)看,這種策略通常是最有效的,可以幫助減少項(xiàng)目中的峰值內(nèi)存使用

  • Logical entity: group assets belonging to the same logical entity together. For example, UI layout assets, textures, sound effects. Or character models and animations.譯:邏輯實(shí)體:將屬于同一邏輯實(shí)體的資產(chǎn)分組在一起。例如,UI布局資產(chǎn),紋理,音效。或者角色模型和動(dòng)畫(huà)。

  • Type: group assets of the same type together. For example, music files, textures.譯:類(lèi)型:將相同類(lèi)型的資產(chǎn)組合在一起。例如,音樂(lè)文件,紋理。

Depending on the needs of your project, one of these strategies might make more sense than the others. For example, in a game with many levels, organizing according to concurrent usage might be the most efficient both from a project management and from a runtime memory performance standpoint. At the same time, you might use different strategies for different types of assets. For example, your UI assets for menu screens might all be grouped together in a level-based game that otherwise groups its level data separately. You might also pack a group that contains the assets for a level into bundles that contain a particular type of asset.

譯:根據(jù)項(xiàng)目的需要,其中一種策略可能比其他策略更有意義。例如,在一款擁有許多關(guān)卡的游戲中,根據(jù)并發(fā)使用進(jìn)行組織可能是最有效的方法,無(wú)論是從項(xiàng)目管理還是從運(yùn)行時(shí)內(nèi)存性能的角度來(lái)看。與此同時(shí),您可以針對(duì)不同類(lèi)型的資產(chǎn)使用不同的策略。例如,在基于關(guān)卡的游戲中,你的菜單屏幕UI資產(chǎn)可能都被組合在一起,否則它的關(guān)卡數(shù)據(jù)就會(huì)被單獨(dú)分組。您還可以將包含關(guān)卡資產(chǎn)的組打包到包含特定類(lèi)型資產(chǎn)的包中。

See?Preparing Assets for AssetBundles?for additional information.

譯:有關(guān)更多信息,請(qǐng)參見(jiàn)為資產(chǎn)包準(zhǔn)備資產(chǎn)。


Safely editing loaded Assets

You can safely edit loaded Assets in the following situations:

譯:在以下情況下,您可以安全地編輯加載的資產(chǎn):

  • The Asset is loaded from an Asset Bundle.譯:資產(chǎn)是從AB資產(chǎn)包中加載的

  • The application is running in a Player, not in the Editor.譯:應(yīng)用程序運(yùn)行在播放器中,而不是在編輯器中

  • When you enable the?Use Existing Build (requires built groups)?option in?Play Mode Scripts.譯:當(dāng)您在播放模式腳本中啟用Use Existing Build?(需要構(gòu)建組)選項(xiàng)時(shí)

In these cases, the Assets exist as a copy in active memory. Changes made to these copied Assets don't affect the saved Asset Bundle on disk and any changes don't persist between sessions.

譯:在這些情況下,資產(chǎn)作為一個(gè)副本存在于活動(dòng)內(nèi)存中。對(duì)這些復(fù)制的資產(chǎn)所做的更改不會(huì)影響磁盤(pán)上保存的資產(chǎn)包,并且會(huì)話(huà)之間的任何更改都不會(huì)持久。

For other situations, including when you enable the?Use Asset Database (fastest)?or?Simulate Groups (advanced)?properties in the playmode settings, Unity loads the Assets directly from the Project files. This means that Unity saves any modifications to the Asset during runtime to the Project Asset file and that those changes will persist between different sessions.

譯:對(duì)于其他情況,包括當(dāng)你在播放模式設(shè)置中啟用使用資產(chǎn)數(shù)據(jù)庫(kù)(最快)或模擬組(高級(jí))屬性時(shí),Unity直接從項(xiàng)目文件中加載資產(chǎn)。這意味著Unity在運(yùn)行時(shí)將對(duì)資產(chǎn)的任何修改保存到項(xiàng)目資產(chǎn)文件中,并且這些更改將在不同的會(huì)話(huà)之間持續(xù)存在。

If you want to make runtime changes to an Asset, Unity recommends that you create a new instance of the GameObject you want to modify and use the copy for any runtime changes. This eliminates the risk that you might accidentally modify the original Asset file. The following code example demonstrates creating a new copy of a loaded Asset:

譯:如果你想要對(duì)資產(chǎn)進(jìn)行運(yùn)行時(shí)更改,Unity建議你創(chuàng)建一個(gè)你想要修改的游戲?qū)ο蟮男聦?shí)例,并使用該副本進(jìn)行任何運(yùn)行時(shí)更改。這消除了您可能不小心修改原始Asset文件的風(fēng)險(xiǎn)。下面的代碼示例演示了如何創(chuàng)建已加載資產(chǎn)的新副本:

If you use the above method to use a copy of an Asset, be aware of the following:

譯:如果您使用上述方法來(lái)使用資產(chǎn)的副本,請(qǐng)注意以下事項(xiàng):

  • You must use either the original Asset or the AsyncOperationHandle when you release the Asset, not the current instance of the Asset.譯:當(dāng)您釋放資產(chǎn)時(shí),必須使用原始資產(chǎn)或AsyncOperationHandle,而不是資產(chǎn)的當(dāng)前實(shí)例

  • When you instantiate an Asset that has references to other Assets in this way, Unity doesn't create new instances of the referenced Assets. The references for the newly instantiated copy target the original Project Asset.譯:當(dāng)你以這種方式實(shí)例化一個(gè)有其他資產(chǎn)引用的資產(chǎn)時(shí),Unity不會(huì)創(chuàng)建被引用資產(chǎn)的新實(shí)例。新實(shí)例化的副本的引用以原始項(xiàng)目資產(chǎn)為目標(biāo)。

  • Unity invokes MonoBehaviour methods like Start(), OnEnable(), and OnDisable() on the new instance.譯:Unity在新實(shí)例上調(diào)用MonoBehaviour方法,如Start(), OnEnable()和OnDisable()。



Unity_Addressable_在編輯器中管理Addressable的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
库车县| 连城县| 沂源县| 蒙自县| 葫芦岛市| 祁连县| 界首市| 沂水县| 阜平县| 阿克苏市| 莲花县| 晋中市| 梁河县| 新郑市| 临西县| 临澧县| 新河县| 汤原县| 保山市| 灵璧县| 吉首市| 任丘市| 台前县| 庆阳市| 林周县| 合水县| 德江县| 翁牛特旗| 偏关县| 沛县| 阿勒泰市| 务川| 开江县| 滦平县| 南开区| 大连市| 泉州市| 新田县| 遂宁市| 碌曲县| 浦县|