CSV to Scriptable Object converter CSV to Scriptable Object converter

CSV to Scriptable Object converter

The CSV importing tool imports comma separated value files and creates or updates scriptable object assets in a unity project. The tool allows designers to create massive amounts of data for their game, and easily import them as instances of predefined ScriptableObjects.

The tool was custom built to work on specific data asset types from the game Guilds of Greybrook. The designers were able to designate folder paths to search for import CSV file locations, export ScriptableObject locations, and art asset locations. The tool would then (re)construct every line of the CSV file as the specified ScriptableObject type.

This tool saved the team significant time, Guilds of Greybrook contains over 300 ScriptableObjects that were modified and updated over the course of 4 months of pre-production. The iterative design of the project would have been slowed tremendously if the ScriptableObjects were updated manually. The importing tool I’ve developed allows them to update or add all scriptable objects in a matter of seconds. The tool has a custom settings page that tells the tool where to look for the predefined CSV files it was built for. It also has folders designating where to output the ScriptableObjects to. The project required additional settings for building the ScriptableObjects such as sprite folder paths to update art automatically as it becomes available. This was used to update member art and contract art. Dice pip art was also handled by a custom settings page of a different tool I made.

All imports start by gathering the user’s provided data.

List<string> lineList =
File.ReadAllLines(_toImport.GetPath()).ToList();
lineList.RemoveAt(0);
string[] lines = lineList.ToArray();
string rootPath =
SO_CSV_ImporterSettings.GetOrCreateSettings()
.rootPaths[importType];
SO_CSV_ImporterSettings settings =
SO_CSV_ImporterSettings.GetOrCreateSettings();

Example of contracts csv file

Example of members csv file

Example of dice csv file


← Back to projects