GooglePlayOBBDownloader Code problem

Hello,
well just try to implement the GooglePlayDownloader from Unity Store http://u3d.as/content/unity-technologies/google-play-obb-downloader/2Qq

  1. How do you implement the Code ? Do you make a separate Scene that loads after the Start Screen that checks if the obb file is there ? If not it downloads the obb and if yes it loads the next Scene ?

I’m really not shure how to implement it correct… so if someone would like to share a code snippet that i can use and tell me what’s the best way to do i would be very very happy :slight_smile:

Here is what i want to do but i have no test possibilities … is this correct ?

using UnityEngine;
using System.Collections;

public class ObbCheck : MonoBehaviour {

	// Use this for initialization
	void Start () 
	{
		if (!GooglePlayDownloader.RunningOnAndroid())
		{
			return;
		}
		
		string expPath = GooglePlayDownloader.GetExpansionFilePath();
		string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
		string patchPath = GooglePlayDownloader.GetPatchOBBPath(expPath);

		if (mainPath == null || patchPath == null) {		
			GooglePlayDownloader.FetchOBB();
			return;
		}	

	}	

}

Thank you !!!

Yes, your first scene ends up in the apk, all other scenes end up in the obb. Your first scene should do the check.

Also, only check for the existence of the patch file if you are using a patch file. Unity automatic splitting doesn’t generate a patch file.

I found a little tutorial about that
http://labs.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/