Beispiel #1
0
    public void SalvarEstrelasLevel(string levelAtual, int estrelasNum, string faseMestra)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      fs = File.Create(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + "estrelas.data");

        EstrelaClass estrelasObj = new EstrelaClass();

        estrelasObj.estrelas = estrelasNum;
        bf.Serialize(fs, estrelasObj);
        fs.Close();
    }
Beispiel #2
0
    public void SalvarEstrelasTotalMestra(string faseMestra, int estrelasNum)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      fs = File.Create(Application.persistentDataPath + "/Mestra" + faseMestra + "Star.data");

        EstrelaClass estrelasObj = new EstrelaClass();

        estrelasObj.estrelas = estrelasNum;
        bf.Serialize(fs, estrelasObj);
        fs.Close();
    }
Beispiel #3
0
    public int LoadEstrelas(string levelAtual, string faseMestra)
    {
        int temp = 0;

        if (File.Exists(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + "estrelas.data"))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      fs = File.Open(Application.persistentDataPath + "/Level" + levelAtual + "_" + faseMestra + "estrelas.data", FileMode.Open);

            EstrelaClass estrelasObj = (EstrelaClass)bf.Deserialize(fs);
            fs.Close();
            temp = estrelasObj.estrelas;
        }
        return(temp);
    }
Beispiel #4
0
    public int LoadEstrelasMestra2()
    {
        int temp = 0;

        if (File.Exists(Application.persistentDataPath + "/Mestra2Star.data"))
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream      fs = File.Open(Application.persistentDataPath + "/Mestra2Star.data", FileMode.Open);

            EstrelaClass estrelasObj = (EstrelaClass)bf.Deserialize(fs);
            fs.Close();
            temp = estrelasObj.estrelas;
        }
        return(temp);
    }