Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075922 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:48:24 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)How to "save the game"? in unity
Pages: [1]
Print
Author Topic: How to "save the game"? in unity  (Read 560 times)
BudaDude
Level 0
**



View Profile
« on: September 09, 2011, 08:50:42 PM »

Hello,
Im making an old style space shooter. I set up a high score system but everytime i exit the game and restart it, I lose my high scores. Undecided
I did write the game in C# also
So my question is does anyone know how I can save that variable?
Logged
Danmark
Level 7
**



View Profile
« Reply #1 on: September 10, 2011, 02:48:52 AM »

System.IO (see Directory and FileStream).
Logged
biomechanic
Level 3
***


View Profile
« Reply #2 on: September 10, 2011, 07:47:19 AM »

For a simple high score table this should do the trick: http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
Logged
Dropout
Level 0
**


View Profile
« Reply #3 on: September 10, 2011, 10:33:56 AM »

PlayerPrefs is probably the best way to do it.

If you use playerprefs, you just serialize the things you are interested to a key, and Unity will take care of placing it in the correct place for each platform
Logged

BudaDude
Level 0
**



View Profile
« Reply #4 on: September 10, 2011, 02:39:20 PM »

Thanks guys. Your the best  Gentleman
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic