Beispiel #1
0
        static void SaveVersionNumFile(Dictionary <string, VersionNumItem> data, string savePath)
        {
            VersionNum ver = new VersionNum(EditorTools.mGame, EditorTools.GetRemoteFolder(), EditorTools.mVersion);

            foreach (KeyValuePair <string, VersionNumItem> pair in data)
            {
                ver.addItem(pair.Value);
            }
            ver.End();

            string newSavedPath = Path.Combine(DeviceInfo.PersistRootPath, "Assets/StreamingAssets/Config/VerRes.bytes");

            IO.SaveToFile(ver, newSavedPath);
            IO.SaveToFile(ver, savePath);
        }
Beispiel #2
0
        static Dictionary <string, VersionNumItem> ReadVersionNumFile(string fileName)
        {
            Dictionary <string, VersionNumItem> DicVersionNum = new Dictionary <string, VersionNumItem>();

            // 如果文件不存在,则直接返回
            if (File.Exists(fileName) == false)
            {
                return(DicVersionNum);
            }

            VersionNum col = IO.LoadFromFile <VersionNum>(fileName);

            if (col != null)
            {
                foreach (VersionNumItem item in col.Files)
                {
                    DicVersionNum.Add(item.FileName, item);
                }
            }

            return(DicVersionNum);
        }