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

 

About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a Flutter freelancer and most importantly developer educator, he doesn't have a lot of free time 😅 Yet he still manages to squeeze in tough workouts 💪 and guitar 🎸

You may also like

Flutter Custom & Staggered Page Transition Animation Tutorial

Flutter Firebase & DDD Course [5] – Sign-In Form Logic

  • 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?

  • 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….

  • 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.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >