I am trying to create a ScriptableSingleton to save certain values for a tool window I developed. The data is saved and loaded as long as Unity is running, but after exiting and restarting Unity, the saved data is not loaded. Is there a solution?
ScriptableSingleton Code:
using UnityEditor;
[FilePath("ProjectSettings/Test.asset", FilePathAttribute.Location.ProjectFolder)]
public class TestSaver : ScriptableSingleton<Test>
{
private string testValue;
public static string TestValue
{
get => instance.testValue;
set
{
if(instance.testValue != value)
{
instance.testValue = value;
instance.Save(true);
}
}
}
}
TestSaver : ScriptableSingleton<Test>but haven't shown us theTesttype. Did you mean to writeTestSaver : ScriptableSingleton<TestSaver>, using the curiously recurring template pattern as shown in the docs? \$\endgroup\$