Loading data from a CSV file
The next thing to do is tell InstructionModel to read its data from an external CSV file.
If you recall, we decided to compose our content using a spreadsheet, and then export it into a comma-separated values (CSV) file. We will read this data into the app at runtime. If you're using the one provided with the book, the filename is instructionsCSV.csv.
Import the CSV file as an asset into your project. Since we are going to load it from our scripts at runtime, it needs to be put into a specially named folder, Resources, anywhere within Assets.
Drag the CSV file from your file system into the Project Assets/HowToChangeATire/Resources folder in Unity (or use main menu Assets | Import New Asset).
In the InstructionModel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access