示例#1
0
 public static void LoadPawnData(ref Pawn.PawnData data)
 {
     if (!string.IsNullOrEmpty(Instance.PawnData))
     {
         data = JsonUtility.FromJson <Pawn.PawnData>(Instance.PawnData);
     }
 }
示例#2
0
    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);
    }