saving inventory to database

Hi all,

got an inventory script working quite nicely where you can pick up items and have them appear in a bag, delete them from the bag etc. Picking up and deleting items also updates the user's inventory table in the database. All working fine but I am unsure how to restore the inventory state when they log back into the game. Obviously I can load all the item data from the database and populate the inventory array with the data but the part I'm not sure about is displaying the the item's 2D texture in the bag again. Is there a way to somehow store the item's Texture2D object in the database as well or should I just create a massive array in Unity with every item's ID and 2D texture and when the saved data is loaded from the database find a match with the ID and grab the texture?

Thanks in advance Bill

I would use the second approach. Saving only the necessary information in the database (item ID) even if it was a database supporting binary objects. Use a hashtable (key / value pairs) to retrieve the texture to the item on load.

you can use Siaqodb http://siaqodb.com/?p=482 true database solution for Unity3D, simple, fast, small footprint

cool - thanks for your thoughts.