Esempio n. 1
0
        public void LoadFile(string filename)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(MapPointDataBase));
            FileStream    stream     = new FileStream(Application.dataPath + XML_DIR + filename + ".xml", FileMode.Open);

            mapPointDB = serializer.Deserialize(stream) as MapPointDataBase;
            stream.Close();
            fileread = true;
        }
Esempio n. 2
0
        private IEnumerator PrepareDataFile(string filename)
        {
            debugText.text = Application.platform.ToString();

            if (Application.platform == RuntimePlatform.Android)
            {
                TextAsset     textAsset  = (TextAsset)Resources.Load(filename, typeof(TextAsset));
                XmlSerializer serializer = new XmlSerializer(typeof(MapPointDataBase));
                Stream        stream     = new MemoryStream(textAsset.bytes);
                StreamReader  textReader = new StreamReader(stream);

                mapPointDB = (MapPointDataBase)serializer.Deserialize(textReader);
                stream.Dispose();
                fileread = true;
            }
            else
            {
                LoadFile(filename);
            }

            yield break;
        }