Пример #1
0
    IEnumerator AutoSave()
    {
        yield return(new WaitForSeconds(30));

        SaveLoadJson.SaveData();
        StartCoroutine(AutoSave());
    }
Пример #2
0
 void Start()
 {
     jsonSavePath = Application.persistentDataPath + "/cuberunner.json";
     Debug.Log(jsonSavePath);
     if (File.Exists(jsonSavePath))
     {
         SaveLoadJson.LoadData();
     }
 }
Пример #3
0
 void Start()
 {
     jsonSavePath = Application.persistentDataPath + "/lemonadestand.json";
     Debug.Log(jsonSavePath);
     if (File.Exists(jsonSavePath))
     {
         SaveLoadJson.LoadData();
     }
     StartCoroutine(AutoSave());
 }
Пример #4
0
        public List <Actor> GetClasses()
        {
            var result  = new List <Actor>();
            var classes = SaveLoadJson.GetAllClasses();

            foreach (var item in classes)
            {
                result.Add(item);
            }

            return(result);
        }
Пример #5
0
        private void CreateNewHero_Click(object sender, RoutedEventArgs e)
        {
            player.Name           = NewHeroNameTB.Text;
            player.CharacterClass = CharacterClassesCB.SelectedValue.ToString();
            player.Strength       = StringFunctions.StringToInteger(ClassStrengthTB.Text);
            player.Intelligence   = StringFunctions.StringToInteger(ClassIntelligenceTB.Text);
            player.Dexterity      = StringFunctions.StringToInteger(ClassDexterityTB.Text);
            player.Vitality       = StringFunctions.StringToInteger(ClassVitalityTB.Text);
            player.Speed          = StringFunctions.StringToInteger(ClassSpeedTB.Text);

            SaveLoadJson.SaveNewHero(player);
            Application.Current.Properties["PageData"] = player.Name;

            var nav = GetNavService();

            nav.Navigate(new Uri("Travel.xaml", UriKind.RelativeOrAbsolute));
        }
Пример #6
0
 void Start()
 {
     item = this;
     SaveLoadJson.Load();
     for (int i = 0; i < BauEspacos.Length; i++)
     {
         if (colecao == 0)
         {
             transform.localPosition = InvEspacos[espacoAtual];
             Controlador.invEspacosContem[espacoAtual] = true;
         }
         else
         {
             transform.localPosition = BauEspacos[espacoAtual];
             Controlador.bauEspacosContem[espacoAtual] = true;
         }
     }
 }
Пример #7
0
 void GameOver()
 {
     SceneManager.LoadScene(0);
     SaveLoadJson.SaveData();
 }
Пример #8
0
 public void ClickTheButton()
 {
     SaveLoadJson.SaveData();
 }
Пример #9
0
 private void InitPlayer()
 {
     player = SaveLoadJson.LoadHero(Application.Current.Properties["PageData"].ToString());
 }