Hi! I’m trying out Game Foundation and I want to save all the changes that are made in Runtime. So I found this code in the official tutorial:
using UnityEngine;
using UnityEngine.GameFoundation;
public class SaveGame : MonoBehaviour
{
IDataPersistence localPersistence;
void Awake()
{
// choose what format you want to use
JsonDataSerializer dataSerializer = new JsonDataSerializer();
// choose where and how the data is stored
localPersistence = new LocalPersistence(dataSerializer);
// tell Game Foundation to initialize using this
// persistence system. Only call Initialize once per session.
GameFoundation.Initialize(localPersistence);
}
public void Save()
{
GameFoundation.Save(localPersistence);
}
public void Load()
{
GameFoundation.Load(localPersistence);
}
}
But I’m having this problem:
Any help will be appreciated!