DownloadObb.cs 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine;
  2. using System.Collections;
  3. public class DownloadObb : MonoBehaviour {
  4. private void Awake()
  5. {
  6. //#if UNITY_ANDROID && !UNITY_EDITOR
  7. // if (!GooglePlayDownloader.RunningOnAndroid())
  8. // {
  9. // Continue("not android");
  10. // return;
  11. // }
  12. // string expPath = GooglePlayDownloader.GetExpansionFilePath();
  13. // if (string.IsNullOrEmpty(expPath))
  14. // {
  15. // Continue("no obb file");
  16. // return;
  17. // }
  18. // string mainPath = GooglePlayDownloader.GetMainOBBPath(expPath);
  19. // string patchPath = GooglePlayDownloader.GetPatchOBBPath(expPath);
  20. // if (mainPath == null || patchPath == null)
  21. // {
  22. // GooglePlayDownloader.FetchOBB();
  23. // Continue("all done");
  24. // }
  25. //#else
  26. Continue("need no obb");
  27. //#endif
  28. }
  29. private void Continue(string reason)
  30. {
  31. Debug.LogWarning(reason);
  32. Application.LoadLevel("_loader");
  33. }
  34. }