Creating Lookup Tables

Since Unity doesn't have native support for database access outside of using C#, what would be the best option for creating lookup tables?

I'm looking to create several "shops", for example, each of which has different "inventory": different items, different quantities, different prices. The inventory, price and quantity would change over time (due to in-game factors). Because none of the shops would have the same inventory, quantity or price, it seems to me that it would be more advantageous to have all items in a "lookup table". At "New Game", the shops would be seeded with items and random quantities from this table. Player action would alter the quantity (and price over time) of the items that a shop sells. Because the shop inventory would be menu based, I don't think that it would be in the best interest to have these items as instantiated objects...instead, they could be "read" from the lookup table.

Am I thinking of this the wrong way? I'm developing for desktop first, and POSSIBLY for the web (where the 1MB PlayerPrefs limit may color my implementation down the line :D). iPhone is not in the picture.

Thanks, Chris

Sure, in Unity you have access to all .Net's collections, some of which would be ideal for this (such as the Hashtable or Generic Dictionary).

Read here for more info about using arrays and collections in unity.

Mono has a managed-assembly version of SQLLite3 ( which you could use to save/query records from the harddrive.

That won't fly for a website though, the Unity client would have to be part of a larger webapp. You can't use PlayerPrefs even if there weren't size constraints, because it wouldn't be secure against malicious users.

Take a look at ScriptableObjects as well.

Using these allows you to create custom defined serialized objects which are included in your project as assets (much like GUISkins, Fonts, Materials, etc).

This prevents having to generate all the objects at runtime (although you have to load them), which may or may not be advantageous, depending on creating complexity and platform (iPhone may be quite slow at creating lots of objects vs simply loading them).