Hello,
I have a trouble with scriptable object’s missing data after I reopen unity… So, I have a scriptable object class that has a test list, and a function that adds strings to that list. Then I have a monobehaviour class where I call that “Add” function. Everything works perfectly, during playmode, and editor mode -The list will get populated properly. HOWEVER, when I close unity, and open it again… the list in that scriptable object becomes EMPTY …
public class ScriptableFile : ScriptableObject
{
public List<string> test;
public void Add(string s)
{
test.Add(s);
}
}
/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
public class TEMPTEST : MonoBehaviour {
public ScriptableFile file;
void Update () {
if (Input.GetKeyDown(KeyCode.G))
{
string s = "a string var";
file.Add(s);
file.Add("literal string value");
}
}
}