Import from CSV
To set up importing from a CSV file, follow these steps:
- Create a GameTable object (right-click in the Project window and choose Create / Game Tables / Game Table).
- Set up the GameTable object properties:
- Choose CSV in the Source Type dropdown.
- In the Asset field, reference the
.csvfile (aTextAsset) to import from. - In the Search Path field, enter the path to the folder containing the Prefabs the CSV file references. The path is relative to the project root, for example
Assets/Prefabs/Units. - Optional. Specify additional settings that alter the way the table data should be interpreted. For example, you can choose whether to use object-per-row or property-per-row orientation. For more, see GameTable Inspector.
- Click Apply Game Table.
- Check the Console window. If everything went well, it should contain a message like the following:
Game Tables: modified 5 objects (of 5), 53 properties (of 88), 0 items removed
If the Console contains any errors, address them and click Apply Game Table again.
- Optional. Save all the changes made by Game Tables via File / Save Project.