- Home /
Loading Assetbundles in Editor-script
Hi,
I am trying to use WWW call in a Editor window to load a assetbundle. It does the call but the isDone flag never becomes true.
Is this possible to do or is there another way of load assetbundles in a editor script?
Here is the code I am using:
static WWW _loadedAsset = null;
static void loadAssetBundle()
{
_loadedAsset = null;
_loadedAsset = new WWW("file://"+Application.dataPath+"/file.assetbundle");
}
void OnGUI()
{
if (_loadedAsset == null)
{
if (GUILayout.Button("Start") == true)
{
loadAssetBundle();
Debug.Log("START");
}
}
}
void Update()
{
if (_loadedAsset != null)
{
if (_loadedAsset.isDone)
{
Debug.Log("DONE");
}
else
{
Debug.Log("Please Wait....");
}
}
}
Answer by Hugh · Sep 29, 2010 at 03:53 PM
just don't check for it to be done, as it will load it up pretty much as soon as if it is local file.
also there is a bug in the www.isDone boolean it doesn't always flag true
simples!
This does not work unfortunately. Unity barfs out an error when you try to access anything in that www call if isDone is not complete. Everything in that www will be null.
Your answer
Follow this Question
Related Questions
How to Load an Assetbundle from an Editor Script 0 Answers
Save Hash128 from Asset Bundle Manifest 2 Answers
Errors When Loading AssetBundles With Concurrent WWW Calls (Unity5) 0 Answers
Positioning a button at the bottom of an editor window 1 Answer
How to update a EditorGUILayout Textfield value in realtime? 0 Answers