public static void LoadPawnData(ref Pawn.PawnData data) { if (!string.IsNullOrEmpty(Instance.PawnData)) { data = JsonUtility.FromJson <Pawn.PawnData>(Instance.PawnData); } }
public static void SavePawnData(Pawn.PawnData data) { data.Pickups.RemoveAll(p => p.RemoveOnNextLevel); foreach (GenericPickup pickup in data.Pickups) { pickup.transform.SetParent(null); } Instance.PawnData = JsonUtility.ToJson(data); }