Quantcast
Channel: Questions in topic: "playerprefs"
Viewing all articles
Browse latest Browse all 1333

How to use PlayerPrefs to save the game

$
0
0
I looked around to find out how to use PlayerPrefs to save my game. There are 2 things I want to save. I have a total score (the total score are all the scores of all the played levels. The jscript I use for the totalScore is this function OnGUI(){ GUI.skin = ScoreSkin; GUI.Label(Rect(Screen.width*0.09,Screen.height*0.68,200,35), "" + (levelscore01 + levelscore02 + ...)); } Now I want to save the levelscores and the Totalscore and beside the score, I want the game saves every unlocked level. So when I finished level 1, level 2 will unlock. And if it's unlocked, I want to the android device will save that to resume the game when you quit the game. Someone who can help me out? I hope you understand what I mean **EDIT** First of all, this is the script I use for the totalScore var ScoreSkin:GUISkin; static var Season1TotalPoints = true; static var season1points01: int; static var season1points02: int; static var season1points03: int; static var season1points04: int; static var season1points05: int; static var season1points06: int; function OnGUI(){ GUI.skin = ScoreSkin; if (Season1TotalPoints){ GUI.Label(Rect(Screen.width*0.09,Screen.height*0.68,200,35), "" + (season1points01 + season1points02 + season1points03 + season1points04 + season1points05 + season1points06)); } } Maybe you guys can help me first with this. Please help :D

Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>