Chapter 8: Story API – Accessing ink Variables and Functions
In this chapter, we will discuss how to use the ink Unity API to work with variables and functions. Any variables or functions defined in ink can be accessed from any point in its code. The API provided by the ink-Unity Integration plugin provides an interface through its variablesState
property to access any defined variables. This is also true of a method provided by the EvaluateFunction()
API, which can access any functions defined in the ink code. Understanding this functionality is key to creating more complex projects by using the ink-Unity Integration plugin as a bridge between an ink story and Unity code.
In this chapter, we will cover the following main topics:
- Changing ink variables outside a story
- Calling ink functions externally
- Controlling a story through variables and functions