dynamically load packages from web and local folders

how is the code to load a “character01.unitypackage”
from web and local folders
and extract the prefab, textures, scripts, etc.

am asking this because i cant do it with www.assetbundle or resources

1 week trying to find the right code.

thanks

well you cant just ‘extract’ during gameplay, what you want to do is load the package and pass them into an array through a method like this:

function Start () {
    var www = WWW ("http://myserver/myBundle.unity3d");
    yield www;
    // Get the designated main asset and instantiate it.
    Instantiate(www.assetBundle.Load("assetName");
}

or you could use LoadAll() to add them to an array