I have the below code. What could possibly make this not work? Other PlayerPrefs seem to work fine. The log always shows that it restores "" and yet it always saves my actual text.
EDIT: I've just discovered that my "OnDisable" code is being called before "Start". I didn't really think that was possible, but that's the problem. So I guess my question is changing a bit...
EDIT 2: OnDisable was being called before Start because another "Awake" function was disabling this object which apparently immediately runs OnDisable.
public InputField ModuleList;
void Start()
{
ModuleList.text = PlayerPrefs.GetString("ModuleSet", "");
Debug.Log("Restoring " + PlayerPrefs.GetString("ModuleSet", ""));
}
public void OnDisable()
{
Debug.Log("Saving " + ModuleList.text);
PlayerPrefs.SetString("ModuleSet", ModuleList.text);
}