Created
February 3, 2014 21:18
-
-
Save wmiller/8792610 to your computer and use it in GitHub Desktop.
XML Database LoadBundlesCo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEnumerator LoadBundlesCo(System.Action onComplete) | |
{ | |
// Get bundle infos from the database | |
AssetBundleInfo[] bundleInfos = Database.Instance.GetEntries<AssetBundleInfo>(); | |
// Load each bundle using the path in the bundle info | |
foreach (AssetBundleInfo info in bundleInfos) | |
{ | |
string url = "file://" + AssetBundlePath + "/" + info.Name + ".unity3d"; | |
Debug.Log("Loading bundle: " + url); | |
WWW www = new WWW(url); | |
yield return www; | |
// Add the bundle to our collection of loaded bundles | |
loadedBundles.Add(info.DatabaseID, www.assetBundle); | |
} | |
// Call the complete delegate | |
if (onComplete != null) | |
{ | |
onComplete(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment