void _DeserializeToInfo(string json) { var info = JsonConvert.DeserializeObject <FocusUnlockerSaveInfo>(json); focusUnlocker = GetComponent <FocusUnlocker>(); if (focusUnlocker) { focusUnlocker.IsUsed = info.isUsed; } }
void _SerializeToJson() { var info = new FocusUnlockerSaveInfo(); focusUnlocker = GetComponent <FocusUnlocker>(); if (focusUnlocker) { info.isUsed = focusUnlocker.IsUsed; } json = JsonConvert.SerializeObject(info, Formatting.None); }