Loading a compiled ink story
In Chapter 6, Adding and Working with the ink-Unity Integration Plugin, we saw how to add new ink files to a Unity project. After importing the plugin, new files can be created using the Create menu from the Project window. When an ink source was added, the plugin automatically created a compiled JSON file. As we now move into working with the ink API provided by the plugin, we will use the created JSON files for working with a story.
The first step for working with code in Unity is to create a GameObject
. This is a basic container in Unity. Each GameObject
holds at least one component. The different systems in Unity, such as the rendering system (for drawing things on a screen), physics (for detecting whether two things overlap on a screen), and input (for detecting whether a user presses a button) all communicate with these components. When Unity runs a project, it sends data to components matching the system associated with it. For example, to work...