8

GPG Tutorial – Saved Games (Code)

This post contains all the code that’s been written in the YouTube video.

You can read it at your own pace, although watching the video prior to looking at this code example is recommended.

PlayGamesScript.cs

 

CloudVariables.cs

 

ManagerScript.cs

 

UIScript.cs

 

Matej
 

Matej is an app developer with a knack for teaching others. If he's not programming, making tutorials or doing other business, he's mostly working out, listening to audiobooks and taking cold showers.


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    LoomaBox says:

    Thank you VERY MUCH for the Tutorial!!! It is GREAT!!

    Immediately after playing my game in Unity the Console shows the following error:

    NullReferenceException: Object reference not set to an instance of an object
    ManagerScript.Start () (at Assets/Scripts/ManagerScript.cs:14)

    and line 14 refers to: UIScript.Instance.UpdateHighscoreText(); in the void Start()

    it looks like the function returns “null”…

    Another silly thing is that my Highscore does not get back if I stop and start again neither in Unity nor on device. I also doubt if the highscore ever gets saved on the cloud.

    What would you recommend to troubleshoot?


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    Marinos says:

    Same here do you have any solution?


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    Mseddi Mohamed says:

    i couldn’t sign in anymore 🙁 any solution ?


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    Kartikesh Gupta says:

    sir, will u please make tutorial on how to save multiple Playerprefs to google Cloud, i am having great trouble in saving my games… I am new to unity i cannot find a suitable tutorial or documentation explaining how to save multiple PlayerPrefs to google play service cloud. like i want to save coins , unlock state of levels stored in PlayerPrefs…

    Thanks in advance….


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    João says:

    hi

    great tutorial, but i have a problem.
    my app (in internal testing), if i just add EnableSavedGames(), crashes after login.
    i already enable savegames in the google console.

    do you have any ideas? i’ve search all over the internet and i can’t find a answer.


  • Notice: Trying to get property of non-object in /home/resocode/public_html/wp-content/plugins/thrive-comments/includes/class-thrive-comments-front.php on line 540
    ali says:

    I want to other variable eg. level

    How i add level,health eg. variables?

  • seo guide

    ldhrnuuun irggb svkytni cxuo fkzfkokmlgfcchk

  • >