Ejemplo n.º 1
0
    /**** Level Manager Methods ****/

    public static void SaveLevelManager(LevelManager levelManager)
    {
        BinaryFormatter bf      = new BinaryFormatter();
        FileStream      fStream = new FileStream(LevelManagerFilePath, FileMode.Create);

        LevelManagerData levelManagerData = new LevelManagerData(levelManager);

        bf.Serialize(fStream, levelManagerData);
        fStream.Close();
    }
Ejemplo n.º 2
0
    public static float[] LoadLevelManager(ref int spawnPointIndex)
    {
        if (File.Exists(LevelManagerFilePath))
        {
            BinaryFormatter bf      = new BinaryFormatter();
            FileStream      fStream = new FileStream(LevelManagerFilePath, FileMode.Open);

            LevelManagerData characterData = bf.Deserialize(fStream) as LevelManagerData;
            fStream.Close();

            spawnPointIndex = characterData.spawnPointIndex;
            return(characterData.playerSpawnPositions);
        }
        else
        {
            return(new float[6]);
        }
    }