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

 

Leave a comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.


LoomaBox

2 years ago

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?

Marinos

2 years ago

Same here do you have any solution?

Matej Rešetár

2 years ago

Hello! I’ve answered this question on YouTube: https://www.youtube.com/watch?v=0ECRLY2A_-c&lc=z12yylvgxkmyyplz304cftlrryaqxnkig1o

Thanks for asking!

Development made simple

We're here to help you. If you have any questions, let us know.

Copyright 2017 - 2018 Reso Coder © All Rights Reserved