x


Does AssetBundleRequest reuse repeat downloads?

If I make multiple AssetBundleRequests to the same asset will it only trigger one http request? If so (it's a stretch, I know), does it reference count to resource to know when to release it, or do I get multiple copies of the same prefab in memory?

more ▼

asked Jan 06 '10 at 05:08 PM

Max Kaufmann gravatar image

Max Kaufmann
573 10 12 21

Having blundered the previous question, I'll refrain from saying anything definitive. I know at one point multiple calls would in fact download the asset multiple times, and losing references would not necessarily clean them up automatically. Some of that may have changed, but I believe some manual tracking is still necessary on your part.

Jan 09 '10 at 08:41 PM Brian Kehrer

From my own testing, it not only doesn't reuse GET requests to the same URL, but you'll actually get a runtime exception if you try to decode the same assetBundle from the same URL twice. Manual tracking is definitely the answer.

Jan 14 '10 at 05:23 PM Max Kaufmann
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

An AssetBundleRequest never initiates a http request - only the WWW class does. The AssetBundleRequest just loads data from the already downloaded AssetBundle.

more ▼

answered Jan 14 '10 at 02:45 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
9.7k 7 23 102

It makes sense for repeated WWW GETs not to be reused - just because they're idempotent doesn't mean that they always return the same content. But the AssetBundleRequest might detect repeat decodes and reuse content, but actually throws an exception rather than returning a reference to the previous content (confirmed by cooked tests).

Jan 14 '10 at 05:32 PM Max Kaufmann
(comments are locked)
10|3000 characters needed characters left

i am curious does asset bundle needs to be download completly in order to use assetbundlerequest and LoadAsync? if it does, that isnt really something special

more ▼

answered Jun 14 '10 at 12:22 PM

pretender gravatar image

pretender
497 121 134 145

yes, before assets can be loaded from an asset bundle, the asset bundle must first be fully downloaded and loaded into memory

Feb 15 '12 at 01:44 AM mrai
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5068
x382

asked: Jan 06 '10 at 05:08 PM

Seen: 1589 times

Last Updated: Feb 15 '12 at 01:44 AM