Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active January 13, 2019 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/55d75d04ba9952d26fc9de3ac5d3ba31 to your computer and use it in GitHub Desktop.
Save TomoG29/55d75d04ba9952d26fc9de3ac5d3ba31 to your computer and use it in GitHub Desktop.
public void Sample_PlayerPrefs()
{
PlayerPrefs.SetInt("key", 1);
PlayerPrefs.SetString("key", "sample");
PlayerPrefs.SetFloat("key", 0.0f);
PlayerPrefs.Save();
int sample_int = PlayerPrefs.GetInt("key");
string sample_string = PlayerPrefs.GetString("key");
float sample_float = PlayerPrefs.GetFloat("key");
int sample_default_int = PlayerPrefs.GetInt("key", 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment