YarnProject
The scrobject that is the Yarn Project.
public sealed class YarnProject : ScriptableObjectInherits from ScriptableObject
The Yarn Project is a container for your Yarn scripts and related content necessary to actually make use of your dialogue.
It holds the individual Yarn scripts, localisation information, string table, compiled program, and other useful and necessary information.
#Nested Types
- ShadowTableDictionary classThe collection of shadow lines within the project, may be empty.
- ShadowTableEntry structRepresents a shadow line, which is a collection of metadata on that line, and a link to it's origin line
#Fields
#baseLocalization
The base localisation for the project, will default to your machines localisation when the project is created.
public Localization baseLocalization;Type Localization
#compiledYarnProgram
The yarn program.
This is the result of the compilation process and will be a protobuf binary.
public byte[]? compiledYarnProgram;#lineMetadata
#localizations
All the localisations in the project.
public SerializableDictionary<string, Localization> localizations = new SerializableDictionary<string, Localization>();Type SerializableDictionary
#localizationType
The localisation technique used in the project
public LocalizationType localizationType;Type LocalizationType
#Properties
#InitialValues
The default values of all declared or inferred variables in the Program. Organised by their name as written in the yarn
files.
public Dictionary<string, System.IConvertible> InitialValues { get; }Type Dictionary
#NodeNames
The names of all nodes contained within the Program.
public string[] NodeNames { get; }#Program
Gets the Yarn Program stored in this project.
public Program Program { get; }Type Program
The first time this is called, the program stored in compiledYarnProgram is deserialized and cached. Future
calls to this method will return the cached value.
#Methods
#GetLineIDsForNodes(IEnumerable<string>)
Returns a list of all line and option IDs within the requested nodes
public IEnumerable<string> GetLineIDsForNodes(IEnumerable<string> nodes)Parameters
nodesIEnumerable<string>the names of all nodes whos line IDs you covet
Returns IEnumerable: The ids of all lines and options in the requested nodes
This is intended to be used either to precache multiple nodes worth
of lines or for debugging
#GetLocalization(string)
Gets a Localization given a locale code.
public Localization GetLocalization(string localeCode)Parameters
localeCodestringThe locale code to find a Localization for.
Returns Localization: The Localization if one is found for the locale localeCode; baseLocalization
otherwise.
Generated from Yarn Spinner for Unity 3.3.