42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using PixelCrushers;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Beyond
|
|
{
|
|
public class ItemSeenContainer
|
|
{
|
|
public List<int> itemsSeen;
|
|
public List<Skills> skillsSeen;
|
|
}
|
|
|
|
[AddComponentMenu("Pixel Crushers/Save System/Savers/NewItemPopupSaver")]
|
|
public class NewItemPopupSaver : Saver
|
|
{
|
|
public static List<int> itemsSeen = new();
|
|
public static List<Skills> skillsSeen = new();
|
|
|
|
public override void ApplyData(string s)
|
|
{
|
|
if (s == null)
|
|
{
|
|
return;
|
|
}
|
|
ItemSeenContainer container = new ItemSeenContainer();
|
|
JsonUtility.FromJsonOverwrite(s, container);
|
|
itemsSeen = container.itemsSeen;
|
|
skillsSeen = container.skillsSeen;
|
|
}
|
|
|
|
public override string RecordData()
|
|
{
|
|
ItemSeenContainer container = new ItemSeenContainer();
|
|
container.itemsSeen = itemsSeen;
|
|
container.skillsSeen = skillsSeen;
|
|
string json = JsonUtility.ToJson(container, true);
|
|
//Debug.Log(json);
|
|
return json;
|
|
}
|
|
}
|
|
} |