Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!
👩🚒 Getting Help
There are several places you can go to get help with Yarn Spinner.
- Join the Yarn Spinner Discord.
- Tweet at us, at @YarnSpinnerTool.
- To report a bug, file an issue on GitHub.
📦 How To Install Yarn Spinner
To install the most recent release of Yarn Spinner for Unity, please see the Installation Instructions in the Yarn Spinner documentation.
If you want to install this particular version of Yarn Spinner for Unity, follow these steps:
Each release will have a different URL. To upgrade to future versions of Yarn Spinner, you will need to uninstall the package, and reinstall using the new URL.
Installing Yarn Spinner for Unity v2.3.0-beta1 from Git
+
button, and click Add package from git URL...
https://github.com/YarnSpinnerTool/YarnSpinner-Unity.git#v2.3.0-beta1
📜 Changes
Breaking Changes
- The Yarn Spinner compiler's indentation tracking has been rewritten to be more consistent in how it works.
- 🚨 Breaking Change:
if
statements must now all be at the same level of indentation as their correspondingelse
,elseif
, andendif
statements.-
This was already strongly encouraged for readability, but is now a requirement.
-
If an
if
statement is at a different indentation level to its corresponding statements, a compiler error will now be generated. -
The lines and other content inside an
if
statement can be indented as much as you like, as long as it's not less indented than the initialif
statement.For example, the following code will work:
// With indentation <<if $something>> A line! <<else>> A different line! <<endif>> // Without indentation <<if $something>> A line! <<else>> A different line! <<endif>>
The following code will not work:
// With indentation <<if $something>> A line! <<else>> A different line! <<endif>>
-
- 🚨 Breaking Change: Empty lines between options now split up different option groups.
-
Previously, the following code would appear as a single option group (with the options 'A', 'B', 'C', 'D'):
-> A -> B -> C -> D
In Yarn Spinner 2.3 and above, this will appear as two option groups: one containing the options 'A', 'B', and another containing 'C', 'D'.
This change was made in response to user reports that the previous behaviour didn't behave the way they expected.
-
- 🚨 Breaking Change:
Added
-
Methods tagged with the
YarnCommand
andYarnFunction
attribute are now discovered at compile time, rather than at run-time. This makes game start-up significantly faster.-
Yarn Spinner for Unity will search your source code for methods with the
YarnCommand
andYarnFunction
attributes, and generate source code that registers these methods when the game starts up, or when you enter Play Mode in the editor.This is a change from previous versions of Yarn Spinner for Unity, which searched for commands and functions at run-time, which had performance and compatibility implications on certain platforms (notably, consoles).
This search is done automatically in Unity 2021.2 and later. In earlier versions of Unity, you will need to manually tell Yarn Spinner for Unity to check your code, by opening the Window menu and choosing Yarn Spinner -> Update Yarn Commands.
-
-
In Unity 2021.2 and later, you can now see which commands have been registered using
YarnCommand
by opening the Window menu and choosing Yarn Spinner -> Commands... -
DialogueReference
objects can now be implicitly converted tostring
s. -
The
YarnNode
attribute can be attached to astring
property to turn it into a drop-down menu for choosing nodes in a Yarn Project.// A reference to a Yarn Project public YarnProject project; // A node in 'project' [YarnNode(nameof(project))] public string node1; // Another node in 'project' [YarnNode(nameof(project))] public string node2;
-
The
YarnProject.GetHeaders
method has been added, which fetches all headers for a node. -
The
YarnProject.InitialValues
property has been added, which fetches a dictionary containing the initial values for every variable in the project.
Changed
- Fixed a compile error in the Minimal Viable Dialogue System sample in Unity 2019.