Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created December 14, 2014 18:28
Show Gist options
  • Save gluschenko/611378c48717b2b4b560 to your computer and use it in GitHub Desktop.
Save gluschenko/611378c48717b2b4b560 to your computer and use it in GitHub Desktop.
public void StartGame()
{
GetComponent<Common>().SetMenuId(0);
///
if(PlayerPrefs.GetString("From", "") == "Game")
{
PlayerPrefs.SetString("From", "Menu");
GetComponent<Common>().CurrentLevel = PlayerPrefs.GetInt("CurrentLevel", 0);
GetComponent<Common>().TargetScore = PlayerPrefs.GetInt("TargetScore", 0);
GetComponent<Common>().Play();
}
if(PlayerPrefs.GetString("From", "") == "GameWin")
{
GetComponent<Common>().SetMenuId(9);
PlayerPrefs.SetString("From", "Menu");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment