Skip to content

Instantly share code, notes, and snippets.

@masayuki5160
Created January 9, 2014 11:37
Show Gist options
  • Save masayuki5160/8332815 to your computer and use it in GitHub Desktop.
Save masayuki5160/8332815 to your computer and use it in GitHub Desktop.
PlayerPrefsのテスト(参考:http://d.hatena.ne.jp/nakamura001/20110712/1310441315
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