Example #1
0
    //Biggie is the filename that saves the highscores
    private void saveBiggie()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/biff.dat");
        biggieData      data = new biggieData();

        data.setPlayerScore(scores);
        data.setPlayerName(names);

        bf.Serialize(file, data);
        file.Close();
    }
Example #2
0
    //Biggie is the filename that saves the highscores
    private void resetBiggie()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/biff.dat");
        biggieData      data = new biggieData();

        String[] n = new string[10];
        int[]    s = new int[10];
        for (int i = 0; i < 10; i++)
        {
            n [i] = " ";
            s[i]  = 0;
        }
        data.setPlayerScore(s);
        data.setPlayerName(n);
        bf.Serialize(file, data);
        file.Close();
    }