Google Drive for Unity3D plugin.

Upload, explore, download files in someone's Google Drive.

And store your secure data such as score with AppData.

GitHub: https://github.com/midworld/unity-googledrive

and Doxygen Docs

Code:  
  1. var drive = new GoogleDrive();
  2. drive.ClientID = "YOUR CLIENT ID";
  3. drive.ClientSecret = "YOUR CLIENT SECRET";
  4.  
  5. // Request authorization.
  6. var authorization = drive.Authorize();
  7. yield return StartCoroutine(authorization);
  8.  
  9. if (authorization.Current is Exception)
  10. {
  11.    Debug.LogWarning(authorization.Current as Exception);
  12.    yield break;
  13. }
  14.  
  15. // Authorization succeeded.
  16. Debug.Log("User Account: " + drive.UserAccount);
  17.  
  18. // Upload a text file.
  19. var bytes = Encoding.UTF8.GetBytes("world!");
  20. yield return StartCoroutine(drive.UploadFile("hello.txt", "text/plain", bytes));
  21.  
  22. // Get all files.
  23. var listFiles = drive.ListAllFiles();
  24. yield return StartCoroutine(listFiles);
  25.  
  26. var files = GoogleDrive.GetResult<List<GoogleDrive.File>>(listFiles);
  27. if (files != null)
  28. {
  29.    foreach (var file in files)
  30.    {
  31.        // Download a text file and print.
  32.        if (file.Title.EndsWith(".txt"))
  33.        {
  34.            var download = drive.DownloadFile(file);
  35.            yield return StartCoroutine(download);
  36.  
  37.            var data = GoogleDrive.GetResult<byte[]>(download);
  38.            Debug.Log(System.Text.Encoding.UTF8.GetString(data));
  39.        }
  40.    }
  41. }

Code:  
  1. // Upload score in 'AppData'.
  2. int score = 10000;
  3. var bytes = Encoding.UTF8.GetBytes(score.ToString());
  4.  
  5. // User cannot see 'score.txt'. Only your app can see this file.
  6. StartCoroutine(drive.UploadFile("score.txt", "text/plain", drive.AppData, bytes));