Пример #1
0
        public void SaveData()
        {
            if (m_toucheCurves == null)
            {
                return;
            }

            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Create(Application.persistentDataPath + "/savedCurves.dat");

            data = new CurveData(m_toucheCurves);
            bf.Serialize(file, data);
            file.Close();
        }
Пример #2
0
        public void LoadData()
        {
            if (File.Exists(Application.persistentDataPath + "/savedCurves.dat"))
            {
                BinaryFormatter bf   = new BinaryFormatter();
                FileStream      file = File.Open(Application.persistentDataPath + "/savedCurves.dat", FileMode.Open);

                data = (CurveData)bf.Deserialize(file);
                file.Close();

                m_toucheCurves = data.toucheCurves;

                if (m_lineGraph)
                {
                    m_lineGraph.CreateFixedCurves(data);
                }
            }
        }