private void LoadHistory() { lastResourcePacks = new SortedList <string, ResourcePack>(); if (File.Exists(historyPath)) { var obj = JsonMapper.ToObject(File.ReadAllText(historyPath)); if (obj != null) { for (int i = 0; i < obj.Count; i++) { var data = obj[i]; var file = new ResourcePack(); file.ParseFrom(data); lastResourcePacks.Add(file.srcFile, file); } } } }
//all in one pack private void CreateResourcePack(string bundleName, string[] pathes) { var pack = new ResourcePack(); pack.srcFile = bundleName; pack.compression = compression != null ? compression.name : ""; pack.encryption = encryption != null ? encryption.name : ""; pack.resources = pathes; foreach (var item in pathes) { if (resources.ContainsKey(item)) { Debug.LogWarningFormat("Repeated pack {0} in {1} and {2}", item, resources[item].srcFile, pack.srcFile); } } resourcePacks.Add(pack.srcFile, pack); }