Example #1
0
 // reinitializeaza datele importante ale unei sesiuni de joc
 public static void newGame()
 {
     PlayerPrefs.SetInt("first_time", 1);
     population_abilities           = new Chromozome();
     GameData.population_size       = 3000000;
     GameData.resources             = 0;
     GameData.food                  = 0;
     GameData.energy                = 20;
     GameData.currentMainPanelIndex = 0;
 }
Example #2
0
 //incarca din playerprefs toate datele importante ale unui sesiuni de joc
 public static void loadGame()
 {
     population_size = BigInteger.Parse(PlayerPrefs.GetString("population_size"));
     //cand se deschide pentru prima data jocul
     if (population_size == 0)
     {
         population_size = 3000000;
     }
     resources             = PlayerPrefs.GetInt("resources");
     food                  = PlayerPrefs.GetInt("food");
     energy                = PlayerPrefs.GetInt("energy");
     currentMainPanelIndex = PlayerPrefs.GetInt("currentMainPanelIndex");
     population_abilities  = JsonConvert.DeserializeObject <Chromozome>(PlayerPrefs.GetString("abilities"));
     achievements          = JsonConvert.DeserializeObject <Dictionary <string, int> >(PlayerPrefs.GetString("achievements"));
 }