// ----------------------------------------------------------------------------------- /// <summary> /// Loads encrypted saved data /// </summary> public void Load() { if (!System.IO.File.Exists(filePath)) { return; } JSONObject json = IllogicGate.Data.EncryptedFile.ReadJSONObject(filePath); // If necessary, add the missing stuff to the savefile for a valid JSON UpdateToCurrentVersion(json); characterDataByGUID = new Dictionary <string, CharacterStats>(); foreach (JSONObject item in json["characters"].list) { CharacterStats data = new CharacterStats(item); characterDataByGUID.Add(data.guid, data); } // version 2 unlockState = new UnlockState(json["unlock_state"]); }
// --- Methods ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------- protected override void OnInstanceCreated() { unlockState = new UnlockState(); Load(); }