Hi guys,
First of all, I am using unity pro on windows. Please do not give me solutions that work only on mac.
I followed this tutorial. http://labs.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/
But, I only have unity 3.5. So, I did the following.
-
created a asset bundle of all the scenes in my project using the BuildStreamedSceneAssetBundle function
-
After it created a .unity3d file, I used winrar to zip it and then renamed its extension to .obb
-
Created a new scene called SceneLoader and added DownloadObbExample as mentioned in the google obb downloader.
-
Built the .apk with only SceneLoader scene
-
Hence my first apk is 40MB and my obb is 80MB.
-
I uploaded on google and after resolving some errors, I successfully able to download the obb on the device from google play
-
So, when I run my apk on my device, it dowloads the obb.
-
Now, the problem is I cannot load any of the scenes from my .obb . Even the levelcount returns 1
here is the code I am using to load the .obb and then load the scene
string nextScene= "StartingLevel"; //some other scene in my asset bundle
string uri = "file://" + mainPath;
WWW www = WWW.LoadFromCacheOrDownload(uri , 1); //this is correct as my obb is getting downloaded successfully
yield return www;
if (www.error != null)
{
log ("wwww error " + www.error);
}
else
{
log (" tried loading level at "+Time.time);
log (Time.time+" cur level name is "+Application.loadedLevelName
+" number of levels is "+Application.levelCount);
Application.LoadLevel(nextScene);
}
So, could you please tell how I can load my scenes that are there in the .obb?