Search Unity

Reading a DB from Visual Studios into Unity

Discussion in 'Code Editors & IDEs' started by DexRobinson, Feb 22, 2012.

  1. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    I was wondering if you can access a DB you setup in Visual Studios and import the values into your Unity project. Is this possible and if it is does someone have a tutorial or can explain how to do it? Thanks!
     
  2. andorov

    andorov

    Joined:
    Feb 10, 2011
    Posts:
    1,061
    Generally the way I import data into unity projects is by writing an editor extension (static method linked to a menu item), and execute that within the context of the Unity editor.

    For a project of mine, I have a "Import Database" button that connects to Google spread sheets, downloads all the data from a given spreadsheet as a CSV, parses it and then bakes it into serializable Unity assets. Its a really efficient flow that allows for data-driven game mechanics and real-time tweaking of data w/o messing with hard-coded values.
     
  3. DexRobinson

    DexRobinson

    Joined:
    Jul 26, 2011
    Posts:
    594
    Do you have an example script on how to do this? Do you use the WWW class to access the Google doc?