Log in or register to post comments

Yield on the creation of an AssetBundle

July 16, 2014 - 6:15am #9

Hi everyone,

 

I'm currently developing an AR app for Android and iOS devices using Unity Pro and Vuforia.

I'm loading dynamically 3D Objects (stored in BundleAssets) from an external server when a certain ImageTarget is recognized (with Cloud Recognition).

I managed to make a loading bar related to the loading of the server and one related to the creation of the 3D Object using the .progress attribute. But I can't find a way to do one on the creation of the BundleAsset.

 

Does anyone have an idea? Here's a snippet of my code:

		// Start a download of the given URL
		www = WWW.LoadFromCacheOrDownload (BundleURL+name+".unity3d", 1);
		// Wait for download to complete
		yield return www;
		// Load and retrieve the AssetBundle
		AssetBundle bundle = www.assetBundle;
		// Load the object asynchronously
		request = bundle.LoadAsync (name, typeof(GameObject));
		// Wait for completion
		yield return request;

I read there http://answers.unity3d.com/questions/9907/yield-on-www-or-assetbundlerequest-or-both.html that it's supposed to be quite fast but it can take up to 10s with the large 3D Objects I'm using and a mobile connection...

Thanks!

Yield on the creation of an AssetBundle

July 17, 2014 - 9:32am #8

I'm still looking for that, anyone from the team that could confirm that nothing can be done maybe? :P

Yield on the creation of an AssetBundle

July 17, 2014 - 11:09am #7

This is a good question for Unity Answers - you might need to animate the progress bar from Update().

Yield on the creation of an AssetBundle

July 17, 2014 - 11:14am #6

Hi David,

Thanks for taking interest in my topic.

The animation part is not where I'm stuck, I have no problem with that and I'm already doing it with www.progress, but this is just one part of the augmenting process, that's why I need to do it on the creation of the bundle too. But I don't know with which data I can do it as there's no equivalent to .progress for the creation of the bundle (after it's been loaded from the server).

Any idea?

Yield on the creation of an AssetBundle

July 17, 2014 - 11:29am #5

There is a .progress property on the AssetBundleRequest - http://docs.unity3d.com/ScriptReference/AssetBundleRequest.html - is it the instantiation that you're trying to monitor?

Yield on the creation of an AssetBundle

July 17, 2014 - 11:35am #4

There's apparently three steps (taken from Unity Answers):

  • The download of the bytes of the assetbundle
  • The creation of an assetbundle object from those bytes
  • The creation of the Cube object, based on the description of the cube in the assetbundle.

So with WWW.progress I get the info of the download and with the AssetBundleRequest.progress I get the info of the creation of the cube object. I'm already doing those two and they are both quite fast to be done.

In my case, that's the creation of the asset bundle that I want to take the progress, cause it takes quite a while as I'm using 3D of buildings (up to 10 Mb).

 

Any idea? Or should I better try on Unity Answers?

Yield on the creation of an AssetBundle

July 21, 2014 - 7:16am #3

Hey :)

Still no one with an idea if/how I can achieve that?

Yield on the creation of an AssetBundle

July 21, 2014 - 7:19am #2

I don't see how this relates to Vuforia...

 

Yield on the creation of an AssetBundle

July 30, 2014 - 10:46pm #1

How do I replace the Image target through a script to achieve dynamic recognition?

Log in or register to post comments