예제 #1
0
 public PlayerData(SystemPumping player)
 {
     stats    = new int[5];
     stats[0] = player.health;
     stats[1] = player.strength;
     stats[2] = player.mana;
     stats[3] = player.intelligence;
     stats[4] = player.point;
 }
예제 #2
0
    public static void SavePlayer(SystemPumping player)
    {
        BinaryFormatter bf      = new BinaryFormatter();
        FileStream      streams = new FileStream(Application.persistentDataPath + "/player.sav", FileMode.Create);

        PlayerData data = new PlayerData(player);

        bf.Serialize(streams, data);
        streams.Close();
    }