Created
January 9, 2014 11:37
-
-
Save masayuki5160/8332815 to your computer and use it in GitHub Desktop.
PlayerPrefsのテスト(参考:http://d.hatena.ne.jp/nakamura001/20110712/1310441315)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class TestLocalStorage : MonoBehaviour { | |
private int Score = 100; | |
private int Score2; | |
// Use this for initialization | |
void Start () { | |
PlayerPrefs.SetInt("Score", Score); | |
Score2 = PlayerPrefs.GetInt("Score"); | |
if(Score2>0){ | |
guiText.text = "Saved Date : " + Score2; | |
}else{ | |
guiText.text = "Failed!!!"; | |
} | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment