Code Template
Unity-Quicksheet uses various template files to automatically generate '.cs' script files needed to import data from a spreadsheet.
All template files are a simple ascii '.txt' files. So you can easily change if you want it generate other form of script.
The generated scripts are divided into two kind things according to its purpose. One for runtime and the other for editor script.
DataClass.txt | PostProcessor.txt |
Property.txt | ScriptableObjectEditorClass.txt |
ScriptableObjectClass.txt | N/A |
Editor script will be put under the folder, named as 'Editor', a Unity specific folder.
Using Custom Template
One of flxible feature of Unity-QuickSheet is that you can change template files to generated script file whatever you want to.
But there is one thing to keep in mind.
A word which has '$'
for its prefix will be replaced when Unity-QuickSheet generates script files. So you should be careful if you change any word has '$'
if not, the generated script files won't be compiled with getting syntax error.
If you familar with Unity editor script, try to import data from a simple spreadsheet and look at the generated script files. The last of things are self explanation.
Reference
DataClass.txt
$ClassName | A class name of DataClass class. Correspond to name of a spreadsheet. (or 'worksheet' name in case of google spreadsheet) |
$MemberFields | Correspond to name of a 'column-header' in the spreadsheet. |
Property.txt
$FieldName | A member field name of the 'DataClass' class. |
$CapitalFieldName | Same as $FieldName but capitalized. |
ScriptableObjectClass.txt
$ClassName | A 'class name' which derives ScriptableObject class |
$DataClassName | It should same as $ClassName of 'DataClass.txt' template file. |
ScriptableObjectEditorClass.txt
$WorkSheetClassName | Correspond to name of a spreadsheet. (or 'worksheet' name in case of google spreadsheet) |
$ClassName | Same as $ClassName of 'ScriptableObjectClass' class. |
$DataClassName | Same as $ClassName of 'DataClass' class. |
PostProcessor.txt
$AssetPostprocessorClass | |
$ClassName | Same as $ClassName of 'ScriptableObjectClass' class. |
$DataClassName | Same as $ClassName of 'DataClass' class. |