示例#1
0
文件: FileParser.cs 项目: JJJohan/RTS
        public static void ParseFiles()
        {
            if (Application.isEditor)
                Compress();

            string basePath = Application.dataPath;
            string[] mods = Directory.GetFiles(basePath + "/mods", "*.xml");

            CryptoProvider crypto = new CryptoProvider();
            MemoryStream baseData = crypto.DecryptFileToStream(basePath + "/BaseData.Data", "Rens");
            m_dataFile = ZipFile.Read(baseData);

            foreach (string name in mods)
            {
                ParseXML(name, false);
            }

            foreach (ZipEntry entry in m_dataFile)
            {
                if (entry.FileName.EndsWith(".xml"))
                {
                    ParseXML(entry.FileName, true);
                }
            }

            ParseUnitHashes();
        }