예제 #1
0
    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();
        }
    }
예제 #2
0
    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();
        }
    }
예제 #3
0
    public void RemoveSaveDates(int indice)
    {
        List <PropriedadesDeSave> lista;
        PropriedadesDeSave        p = SaveProps[indice];

        lista = SaveProps;

        SavedGames[p.indiceDoSave] = null;
        lista.Remove(p);

        Save();

        lista.Sort();
    }
예제 #4
0
    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);
    }
예제 #5
0
    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);
    }
예제 #6
0
    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();
    }
예제 #7
0
    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);
    }
예제 #8
0
 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);
 }