Can I create an Instance of a ScriptableObject at runtime, feed it Data from JsonUtility and stored that Data again via JsonUtility? Would be nice if I could use this hybrid apprach
Alrighty, works
public void TryScriptableSave()
{
SpacerData data = ScriptableObject.CreateInstance<SpacerData>();
data.testName = "ufisudif";
string jsonData = JsonUtility.ToJson(data);
Debug.Log(Application.persistentDataPath);
File.WriteAllText(Application.persistentDataPath + "\\MyFile.json", jsonData);
}
public void TryScriptableLoad()
{
string jsonData = File.ReadAllText(Application.persistentDataPath + "\\MyFile.json");
Debug.Log(jsonData);
SpacerData data = ScriptableObject.CreateInstance<SpacerData>();
JsonUtility.FromJsonOverwrite(jsonData, data);
Debug.Log(data.testName);
}