Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Any Decent Tutorial about saving to Google Cloud?

Discussion in 'Scripting' started by GladGoblinGames, May 19, 2016.

  1. GladGoblinGames

    GladGoblinGames

    Joined:
    Dec 14, 2011
    Posts:
    118
    I've tried looking all over, and apart from people pasting a whole load of code with no comments about what's happening, I can't seem to find anything at all. I looked at the one on GitHub, but that was less than helpful. All I want, is to save a single file which contains data and then put it on the cloud. I don't want multiple saves, so no need to call ShowSavedGameUI() it will just be a process run in the background.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,380
    Are you searching in the context of unity, or just the context of the cloud api in general?

    This is one of those questions that I'd ignore the unity community out right, and just deal with the google cloud api in general. I mean "saving a file" is no different if I'm writing a video game, or if I'm writing business software. What information am I going to glean from the unity community, other than the injection of a bunch of newb programmers spreading misinformation (sorry unity community, but there is a glut of newb coders here, and that can make finding general answers hard).

    So here's the api documentation for integrating .Net with Google Cloud:
    https://cloud.google.com/storage/docs/json_api/v1/json-api-dotnet-samples#setup-code

    Seems pretty straight forward, they have example code to 'CreateStorageClient', as well as example code of using said storage client to then save a 'stream' to it in the 'UploadStream' example code. And of course 'DownloadStream' shows you how to download data.

    Done is done...

    If you don't know streams, go check out .net streams:
    https://msdn.microsoft.com/en-us/library/system.io.stream(v=vs.110).aspx

    A stream is a generic way to deal with a chunk of data in memory.




    Although, one beef I can see is that it appears the google api is .Net 4.5... ugh. You may have to scrounge up an older version of it.
     
  3. image28

    image28

    Joined:
    Jul 17, 2013
    Posts:
    457
  4. skalev

    skalev

    Joined:
    Feb 16, 2012
    Posts:
    264
    Off topic - but really, that is a big problem here, and the amount of questions being asked before looking for answers hoping that someone will solve them for you, which make this forum (and not to mention Unity Answers, which I've completely stopped using) so littered.
     
  5. GladGoblinGames

    GladGoblinGames

    Joined:
    Dec 14, 2011
    Posts:
    118
    Hi all, thanks for the replies. I've decided not to use the Google Cloud until I can fully get my head around it. Seems like a lot of work/research. I've decided on using some encrypted player prefs. Granted, not the best method, but its the only way I can think of to add at least minimal protection
     
  6. takealuke

    takealuke

    Joined:
    Feb 19, 2016
    Posts:
    6
    Hi all, lordofduct, the api documentation is great, but it doesn't have any info on how to get the DLLs installed in Unity. I'm on a Mac, and I'm having a really hard time figuring that out. Any suggestions?
     
  7. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,380
    managed .net dll's can be placed in your unity project and will automatically be included.

    If the dll exists in a folder named 'Editor', then the dll will only be used during editor time.

    see:
    https://docs.unity3d.com/Manual/UsingDLL.html

    Note, if the dll you're using has a dependency that isn't available in Unity, you must either add it yourself, or it might not be compatible.
     
  8. Lamaseed

    Lamaseed

    Joined:
    Jan 21, 2017
    Posts:
    2
    Hi @xCiter, hi all,

    I was searching for a way to move from the encrypted local files to cloud files. To make the game resistant to frauds and to support moving to another device. I could not really get something out of my searches.

    Did you finally used Google Cloud Platform?