Yarn Spinner for Unity Editor Tools
Yarn Spinner adds items to Unity’s menus, a few windows, sections in the Inspector, and a page in Project Settings.
Menus
| Menu item | What it does |
|---|---|
Creates a new .yarn file. See Adding a script. | |
Creates a new .yarnproject file. See Creating a project. | |
| Creates a C# script for a Dialogue Presenter of your own. See Building Your Own Presenter. | |
| Adds a Dialogue System to your scene: a Dialogue Runner, a Line Presenter, an Options Presenter and a Line Advancer, already connected. | |
| Shows which version of Yarn Spinner you have, with links to the documentation and support. Its shortcut is Ctrl+Shift+Y, or Cmd+Shift+Y on a Mac. | |
| Opens the Yarn Commands window. | |
| Adds the Yarn Spinner samples to your project. See Samples. | |
| For projects using Unity’s Localization package. Adds the assets in your localised asset folders, like voice-over clips, to an Asset Table Collection. |
The Assets > Create items are also in the menu you get when you right-click in the Project window.
Yarn Commands window
Choose to open the Yarn Commands window. It lists every Command in your project, including the built-in ones, with how to call it, like <<wave Rosa>>.
Type in the search field to narrow the list. See Commands for how to write them.
In the Inspector
Yarn Spinner adds to the Inspector for a few kinds of object:
- Yarn Projects: selecting a
.yarnprojectshows its source scripts, localisation settings, line tagging and export tools, and its errors. See The Yarn Project Inspector. - Yarn Scripts: selecting a
.yarnfile shows the Yarn Project it belongs to and any errors in it. See Importing Yarn Files. - Dialogue Runner: when Start Automatically is on, Start Node becomes a dropdown of the nodes in the Dialogue Runner’s Yarn Project, so you pick a node from a list. If Variable Storage is empty, the Inspector says an In Memory Variable Storage will be added when the game runs.
- In Memory Variable Storage: the Debug Variables section lists the variables it holds, with their values, while the game is running.
Project settings
Yarn Spinner adds a page to , under Yarn Spinner. After changing anything, click Apply Changes.
| Setting | Default | What it does |
|---|---|---|
| Update Localised Assets | On | Reimports your Yarn Projects when assets in their localised asset folders are added, moved or deleted. |
| Generate linkings for Functions and Commands | On | Generates the code that connects the methods you’ve marked with [YarnCommand] and [YarnFunction] to the Dialogue Runner. Turn it off to add them yourself in code. |
| Generate YSLS file for attributed methods | On | Writes a .ysls.json file listing those Commands and Functions, so VS Code can autocomplete them. See The .ysls.json file. |
| Keep Unity Localization tables sorted | Off | Only shown when Unity’s Localization package is installed. Keeps the lines in your String Table Collections in order. |
| Enable direct connection to VS Code for Yarn Scripts | Off | Adds an Open in VS Code button to a Yarn Script’s Inspector. |