Ejemplo n.º 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();
        }
    }
Ejemplo n.º 2
0
    public void CriandoJogo()
    {
        PropriedadesDeSave prop = new PropriedadesDeSave()
        {
            nome = input.text, ultimaJogada = System.DateTime.Now
        };
        LoadAndSaveGame           salvador = new LoadAndSaveGame();
        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
            }
        };

        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);
    }