Database and transferring variables

I've been looking around for this, and though I've found some pointers (like "DontDestroyOnLoad") it hasn't quite thrown me into the right direction. My situation is this: I'm having to make different scenes. In each scene are a few vendors with items in stock, and there is the player. Between each scene I need to save what items the vendors currently hold, I need to be able to add/remove items, edit the prices and some more things. Most importantly at the moment is saving what items and in what amounts. I also need to save the player's inventory, with what items the player holds and how much money.

How do I best go about this? I thought of having a universal "DatabaseScript" with a 'DontDestroyOnLoad' and between each scene, set and get players/NPCs.

You're absolutely right with your own suggestion. Have an empty game object with a script attached to it. Call this script gameManager or DatabaseScript or whatever. Add DontDestroyOnLoad to it and use it to store and access all variables that need saving.

Or, if you only have vendors with items in stock just add DontDestroyOnLoad to the vendorsStock script and make sure all the variables are static.

Good luck.