public static SlotSettings FromJSON(string json, ArtRegistry reg) { Dictionary <string, string> tmp = Serial.DictFromJSON(json); int slotNumber = Int32.Parse(tmp["SlotNumber"]); ArtMetaData metaData = reg.Get(Checksum.FromString(tmp["Checksum"])); return(new SlotSettings(slotNumber, metaData)); }
public static ArtRegistry Load(string file) { ArtRegistry reg = new ArtRegistry(file); if (!Util.IsFile(file)) { return(reg); } string json = File.ReadAllText(file); Serial.ListFromJSON <ArtMetaData>(json, ArtMetaData.FromJSON).ForEach(art => reg.AddArt(art)); return(reg); }
private AppSettings SaveArtRegistry() { ArtRegistry.Save(); return(this); }
private AppSettings LoadArtRegistry() { ArtRegistry = ArtRegistry.Load(registryFile()); return(this); }
public void Awake() { root = AppSettings.GetAppSettings().DownloadPath; artReg = AppSettings.GetAppSettings().ArtRegistry; Debug.Log("Using root: " + root); }
private byte[] getAssetBytes(Checksum checksum) { ArtRegistry artReg = AppSettings.GetAppSettings().ArtRegistry; return(Util.ZipAsset(artReg.Get(checksum))); }