RestoreState Purse

Do I need onChange?.Invoke(); at RestoreState(object state) for Purse as well?

Currently when I enter another scene from saved scene, the purse and the inventory are not getting updated. It is strange.

I use PlayerPrefs.GetFloat(…) to pass the balance around as a workaround method. However, the inventory is a bit hard to use PlayerPrefs.

1 Like

Yes, each of the RestoreStates that are in classes that have a form of OnChange event should call that OnChange event at the end of the method to alert listeners that the thing has been reloaded. This got left out in the instruction. Sorry about that.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms