void EscolhiDelete(int indice) { FecharLoadContainer(); PropriedadesDeSave p = lista[indice]; lista = (List <PropriedadesDeSave>)(salvador.CarregarArquivo("criaturesGames.ori")); salvador.ExcluirArquivo("criatures.ori" + p.indiceDoSave); lista.Remove(p); salvador.SalvarArquivo("criaturesGames.ori", lista); lista.Sort(); if (lista.Count > 0) { BotaoCarregarJogo(); } else { AtualizaLista(); } }
void EscolhiDelete(int indice) { FecharLoadContainer(); PropriedadesDeSave p = lista[indice]; //lista = (List<PropriedadesDeSave>)(salvador.CarregarArquivo("criaturesGames.ori")); lista = SaveDatesForJolt.s.SaveProps; //salvador.ExcluirArquivo("criatures.ori" + p.indiceDoSave); lista.Remove(p); //salvador.SalvarArquivo("criaturesGames.ori", lista); SaveAndLoadInJolt.Save(); lista.Sort(); if (lista.Count > 0) { BotaoCarregarJogo(); } else { estado = EstadosDoIniciar.escolhaInicial; AtualizaLista(); } }
public void RemoveSaveDates(int indice) { List <PropriedadesDeSave> lista; PropriedadesDeSave p = SaveProps[indice]; lista = SaveProps; SavedGames[p.indiceDoSave] = null; lista.Remove(p); Save(); lista.Sort(); }
public void CriandoJogo() { PropriedadesDeSave prop = new PropriedadesDeSave() { nome = "Jogo Criado: " + System.DateTime.Now, ultimaJogada = System.DateTime.Now }; LoadAndSaveGame salvador = new LoadAndSaveGame(); List <PropriedadesDeSave> lista = SaveDatesForJolt.s.SaveProps; //List<PropriedadesDeSave> lista = (List<PropriedadesDeSave>)(salvador.CarregarArquivo("criaturesGames.ori")); if (lista != null) { int maior = 0; for (int i = 0; i < lista.Count; i++) { if (lista[i].indiceDoSave > maior) { maior = lista[i].indiceDoSave; } } prop.indiceDoSave = maior + 1; lista.Add(prop); } else { lista = new List <PropriedadesDeSave>() { prop } }; SaveDatesForJolt.s.SaveProps = lista; SaveAndLoadInJolt.Save(); //salvador.SalvarArquivo("criaturesGames.ori", lista); // Voltar();//Deve ser retirado IniciarCarregarCena(prop.indiceDoSave); } void IniciarCarregarCena(int indice) { gameObject.SetActive(false); GameObject G = new GameObject(); SceneLoader loadScene = G.AddComponent <SceneLoader>(); loadScene.CenaDoCarregamento(indice); }
public void CriandoJogo() { gameObject.SetActive(false); PropriedadesDeSave prop = new PropriedadesDeSave() { nome = input.text, ultimaJogada = System.DateTime.Now }; //SaveDatesManager salvador = new SaveDatesManager(); List <PropriedadesDeSave> lista = SaveDatesManager.s.SaveProps;//(List<PropriedadesDeSave>)(salvador.CarregarArquivo("criaturesGames.ori")); if (lista != null) { int maior = 0; for (int i = 0; i < lista.Count; i++) { if (lista[i].indiceDoSave > maior) { maior = lista[i].indiceDoSave; } } prop.indiceDoSave = maior + 1; lista.Add(prop); } else { lista = new List <PropriedadesDeSave>() { prop } }; SaveDatesManager.s.SaveProps = lista; SaveDatesManager.Save(); SaveDatesManager.s.IndiceDoJogoAtualSelecionado = prop.indiceDoSave; GlobalController.g.FadeV.IniciarFadeOutComAction(OnFadeOutComplete); EventAgregator.Publish(EventKey.stopMusic, null); //EventAgregator.AddListener(EventKey.fadeOutComplete, OnFadeOutComplete); } void OnFadeOutComplete() { GlobalController.g.FadeV.IniciarFadeIn(); SceneLoader.IniciarCarregamento(SaveDatesManager.s.IndiceDoJogoAtualSelecionado); }
public static void CarregaSaveDates(int indice) { PropriedadesDeSave p = s.SaveProps[indice]; List <PropriedadesDeSave> lista = s.SaveProps; indice = lista.IndexOf(p); lista[indice] = new PropriedadesDeSave() { ultimaJogada = System.DateTime.Now, nome = lista[indice].nome, indiceDoSave = lista[indice].indiceDoSave }; //salvador.SalvarArquivo("criaturesGames.ori", lista); Save(); }
void EscolhiSave(int indice) { PropriedadesDeSave p = lista[indice]; lista = (List <PropriedadesDeSave>)(salvador.CarregarArquivo("criaturesGames.ori")); indice = lista.IndexOf(p); lista[indice] = new PropriedadesDeSave() { ultimaJogada = System.DateTime.Now, nome = lista[indice].nome, indiceDoSave = lista[indice].indiceDoSave }; salvador.SalvarArquivo("criaturesGames.ori", lista); GameObject G = new GameObject(); SceneLoader loadScene = G.AddComponent <SceneLoader>(); loadScene.CenaDoCarregamento(lista[indice].indiceDoSave); }
public void SetarBotao(System.Action <int> acaoLoad, System.Action <int> acaoDelete, PropriedadesDeSave prop, int indice) { this.acaoLoad += acaoLoad; this.acaoDelete += acaoDelete; nomeDoSave.text = prop.nome; labelDoSave.text = "Save " + (indice + 1); }