Chapter 7: Unity API – Making Choices and Story Progression
This chapter begins with reviewing how to add a script
component to a game object in Unity. By creating a script
component associated with a C# file, code can be written to load the compiled JSON files created by the ink-Unity Integration plugin from ink source files as part of the Unity scene. Next, we will examine how to load an ink story and start to progress through it. We will see how to programmatically make selections of options presented by ink and then how to continue story progression as a result. We will end with an example of a common approach of presenting multiple user interface elements to a player in Unity. A user will be able to click buttons in Unity and guide story progression in a running ink story.
In this chapter, we will cover the following main topics:
- Loading a compiled ink story
- Selecting options programmatically
- Creating a dynamic user interface