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

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

Unity_Addressable_AssetBundle Loading(加載AB包)

2023-04-12 09:39 作者:unity_某某師_高錦錦  | 我要投稿

AssetBundle Loading

The Addressables system packs your assets in AssetBundles and loads these bundles "behind the scenes" as you load individual assets. You can control how AssetBundles load which are exposed on the?BundledAssetGroupSchema?class. You can set these options through the scripting API or under the Advanced options in the inspector of the?AddressablesAssetGroup?inspector.

譯:Addressables系統(tǒng)將您的資產(chǎn)打包在AssetBundles中,并在加載單個(gè)資產(chǎn)時(shí)“幕后”加載這些包。您可以控制AssetBundles如何加載,這些選項(xiàng)在BundledAssetGroupSchema類中公開(kāi)。您可以通過(guò)腳本API或在AddressablesAssetGroup檢查器的高級(jí)選項(xiàng)下設(shè)置這些選項(xiàng)。

UnityWebRequestForLocalBundles

Addressables can load AssetBundles via two engine APIs:?UnityWebRequest.GetAssetBundle, and?AssetBundle.LoadFromFileAsync. The default behavior is to use?AssetBundle.LoadFromFileAsync?when the AssetBundle is in local storage and use?UnityWebRequest?when the AssetBundle path is a URL.

譯:Addressables可以通過(guò)兩個(gè)引擎API加載AssetBundles:UnityWebRequest.GetAssetBundle和AssetBundle.LoadFromFileAsync。默認(rèn)情況下,當(dāng)AssetBundle位于本地存儲(chǔ)中時(shí),使用AssetBundle.LoadFromFileAsync,當(dāng)AssetBundle路徑為URL時(shí),則使用UnityWebRequest。

You can override this behavior to use?UnityWebRequest?for local Asset Bundles by setting?BundledAssetGroupSchema.UseUnityWebRequestForLocalBundles?to true. It can also be set through the BundledAssetGroupSchema GUI.

譯:您可以通過(guò)將BundledAssetGroupSchema.UseUnityWebRequestForLocalBundles設(shè)置為true來(lái)覆蓋此行為,以便在本地Asset Bundle上使用UnityWebRequest。也可以通過(guò)BundledAssetGroupSchema GUI進(jìn)行設(shè)置。

A few of these situations would include:

譯:以下是幾種這樣的情況:

  1. You are shipping local AssetBundles that use LZMA compression because you want your shipped game package to be as small as possible. In this case, you would want to use UnityWebRequest to recompress those AssetBundles LZ4 into the local disk cache.譯:您正在發(fā)布使用LZMA壓縮的本地AssetBundles,因?yàn)橄胍鼓挠螒虺绦虬M可能小。在這種情況下,您希望使用UnityWebRequest將這些AssetBundles LZ4重新壓縮到本地磁盤緩存中。

  2. You are shipping an Android game and your APK contains AssetBundles that are compressed with the default APK compression.譯:?您正在發(fā)行Android游戲,您的APK包含使用默認(rèn)APK壓縮的AssetBundles。

  3. You want the entire local AssetBundle to be loaded into memory to avoid disk seeks. If you use?UnityWebRequest?and have caching disabled, the entire AssetBundle file will be loaded into the memory cache. This increases your runtime memory usage, but may improve loading performance as it eliminates disk seeking after the initial AssetBundle load. Both situations 1 and 2 above result in the AssetBundle existing on the player device twice (original and cached representations). This means the initial loads (decompressing and copying to cache) are slower than subsequent loads (loading from cache)譯:您正在發(fā)布使用LZMA壓縮的本地AssetBundles,因?yàn)橄胍鼓挠螒虺绦虬M可能小。在這種情況下,您希望使用UnityWebRequest將這些AssetBundles LZ4重新壓縮到本地磁盤緩存中。 您正在發(fā)行Android游戲,您的APK包含使用默認(rèn)APK壓縮的AssetBundles。 您希望將整個(gè)本地AssetBundle加載到內(nèi)存中,以避免磁盤尋道。如果使用UnityWebRequest并禁用緩存,則整個(gè)AssetBundle文件將加載到內(nèi)存緩存中。這會(huì)增加您的運(yùn)行時(shí)內(nèi)存使用,但可能會(huì)提高加載性能,因?yàn)樗顺跏糀ssetBundle加載后的磁盤尋道。上述兩種情況1和2都導(dǎo)致AssetBundle在播放器設(shè)備上存在兩次(原始表示和緩存表示)。這意味著初始加載(解壓縮并復(fù)制到緩存)比后續(xù)加載(從緩存中加載)慢。

Handling Download Errors

When a download fails, the RemoteProviderException contains errors that can be used to determine how to handle the failure. The RemoteProviderException is either the?AsyncOperationHandle.OperationException?or an inner exception. As shown below:

譯:當(dāng)下載失敗時(shí),RemoteProviderException包含錯(cuò)誤信息,可用于確定如何處理該失敗。RemoteProviderException是AsyncOperationHandle.OperationException或內(nèi)部異常之一。如下所示:

Possible error strings:

譯:

  • "Request aborted"譯:"請(qǐng)求已中止"

  • "Unable to write data"譯:"無(wú)法寫(xiě)入數(shù)據(jù)"?

  • "Malformed URL"譯:"URL格式錯(cuò)誤"?

  • "Out of memory"譯:"內(nèi)存不足"?

  • "No Internet Connection"譯:"無(wú)網(wǎng)絡(luò)連接"?

  • "Encountered invalid redirect (missing Location header?)"譯:"遇到無(wú)效的重定向(缺少Location標(biāo)頭?)"?

  • "Cannot modify request at this time"譯:"此時(shí)無(wú)法修改請(qǐng)求"?

  • "Unsupported Protocol"譯:"不支持的協(xié)議"?

  • "Destination host has an erroneous SSL certificate"譯:"目標(biāo)主機(jī)具有錯(cuò)誤的SSL證書(shū)"?

  • "Unable to load SSL Cipher for verification"譯:"無(wú)法加載SSL密碼進(jìn)行驗(yàn)證"?

  • "SSL CA certificate error"譯:"SSL CA證書(shū)錯(cuò)誤"?

  • "Unrecognized content-encoding"譯:"未識(shí)別的內(nèi)容編碼"?

  • "Request already transmitted"譯:"請(qǐng)求已經(jīng)傳輸" "

  • "Invalid HTTP Method"譯:HTTP方法無(wú)效"?

  • "Header name contains invalid characters"譯:"標(biāo)頭名稱包含無(wú)效字符"?

  • "Header value contains invalid characters"譯:"標(biāo)頭值包含無(wú)效字符"?

  • "Cannot override system-specified headers"譯:"無(wú)法覆蓋系統(tǒng)指定的標(biāo)頭"?

  • "Backend Initialization Error"譯:"后端初始化錯(cuò)誤"?

  • "Cannot resolve proxy"譯:"無(wú)法解析代理"

  • "Cannot resolve destination host"譯:?"無(wú)法解析目標(biāo)主機(jī)"?

  • "Cannot connect to destination host"譯:"無(wú)法連接到目標(biāo)主機(jī)"?

  • "Access denied"譯:"訪問(wèn)被拒絕"?

  • "Generic/unknown HTTP error"譯:"常規(guī)/未知HTTP錯(cuò)誤"?

  • "Unable to read data"譯:"無(wú)法讀取數(shù)據(jù)"?

  • "Request timeout"譯:"請(qǐng)求超時(shí)"?

  • "Error during HTTP POST transmission"譯:"在HTTP POST傳輸期間發(fā)生錯(cuò)誤"?

  • "Unable to complete SSL connection"譯:"無(wú)法完成SSL連接"

  • "Redirect limit exceeded"譯:?"重定向限制已超出"?

  • "Received no data in response"譯:"沒(méi)有收到響應(yīng)數(shù)據(jù)"?"

  • "Destination host does not support SSL"譯:目標(biāo)主機(jī)不支持SSL"?

  • "Failed to transmit data"譯:"傳輸數(shù)據(jù)失敗"?

  • "Failed to receive data"譯:"接收數(shù)據(jù)失敗" "

  • "Login failed"譯:登錄失敗"?

  • "SSL shutdown failed"譯:?"SSL關(guān)閉失敗"

  • "Redirect limit is invalid"譯:"重定向限制無(wú)效"

  • "Not implemented"譯:"未實(shí)現(xiàn)"

  • "Data Processing Error, see Download Handler error"譯:"數(shù)據(jù)處理錯(cuò)誤,請(qǐng)參閱下載處理程序錯(cuò)誤"

  • "Unknown Error"譯:?"未知錯(cuò)誤"



Unity_Addressable_AssetBundle Loading(加載AB包)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
华蓥市| 博白县| 武宣县| 南靖县| 南郑县| 武冈市| 荥经县| 平顶山市| 牙克石市| 赞皇县| 崇义县| 普兰店市| 广东省| 时尚| 娱乐| 济阳县| 五常市| 云和县| 米林县| 常山县| 昂仁县| 抚远县| 兴仁县| 鄢陵县| 洛南县| 息烽县| 凤城市| 祥云县| 墨竹工卡县| 双柏县| 西藏| 宁夏| 凯里市| 永福县| 安岳县| 宝鸡市| 凭祥市| 张家界市| 石景山区| 吴堡县| 柘荣县|