コード例 #1
0
        //public static string VSPath;
        //public static string VS_Version = "None";

        public static void SaveConfig(VSPConfig save)
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Create(Application.persistentDataPath + "/VSP.conf");

            bf.Serialize(file, save);
            file.Close();
            if (UseDebug)
            {
                Debug.Log("VSP.conf Saved");
            }
        }
コード例 #2
0
        public static VSPConfig LoadConfig()
        {
            if (File.Exists(Application.persistentDataPath + "/VSP.conf"))
            {
                BinaryFormatter bf   = new BinaryFormatter();
                FileStream      file = File.Open(Application.persistentDataPath + "/VSP.conf", FileMode.Open);
                VSPConfig       save = (VSPConfig)bf.Deserialize(file);
                file.Close();
                if (UseDebug)
                {
                    Debug.Log("VSP.conf Loaded");
                }

                return(save);
            }
            return(null);
        }