All pages
Powered by GitBook
1 of 9

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

GetAllVariables()

Method in VariableStorageBehaviour

Summary

Provides a unified interface for exporting all variables. Intended to be a point for custom saving, editors, etc.

public abstract (FloatDictionary FloatVariables, StringDictionary StringVariables, BoolDictionary BoolVariables) GetAllVariables();

Clear()

Method in VariableStorageBehaviour

Summary

public abstract void Clear();

Contains(string)

Method in VariableStorageBehaviour

Summary

Returns a boolean value representing if a particular variable is inside the variable storage.

Parameters

Name
Description

string variableName

The name of the variable to check for.

Returns

true if this variable storage contains a value for the variable named variableName ; false otherwise.

public abstract bool Contains(string variableName);

VariableStorageBehaviour

Class in Yarn.Unity

Inherits from UnityEngine.MonoBehaviour

Summary

A UnityEngine.MonoBehaviour that a DialogueRunner uses to store and retrieve variables.

public abstract class VariableStorageBehaviour : MonoBehaviour, Yarn.IVariableStorage

Remarks

This abstract class inherits from UnityEngine.MonoBehaviour , which means that subclasses of this class can be attached to UnityEngine.GameObject s.

Methods

Name
Description

SetValue(string,float)

Method in

Name
Description

SetValue(string,bool)

Method in

Name
Description

public abstract void SetValue(string variableName, float floatValue);

string variableName

Summary

Parameters

VariableStorageBehaviour

float floatValue

public abstract void SetValue(string variableName, bool boolValue);

string variableName

Summary

Parameters

VariableStorageBehaviour

bool boolValue

Provides a unified interface for loading many variables all at once. Will override anything already in the variable storage.

Clear()

Contains(string)

Returns a boolean value representing if a particular variable is inside the variable storage.

GetAllVariables()

Provides a unified interface for exporting all variables. Intended to be a point for custom saving, editors, etc.

SetAllVariables(FloatDictionary,StringDictionary,BoolDictionary,bool)

Method in VariableStorageBehaviour

Summary

Provides a unified interface for loading many variables all at once. Will override anything already in the variable storage.

public abstract void SetAllVariables(FloatDictionary floats, StringDictionary strings, BoolDictionary bools, bool clear = true);

Parameters

Name
Description

bool clear

SetValue(string,string)

Method in

Name
Description

Should the load also wipe the storage. Defaults to true so all existing variables will be cleared.

System.Collections.Generic.Dictionary<string, float> floats

System.Collections.Generic.Dictionary<string, string> strings

System.Collections.Generic.Dictionary<string, bool> bools

SetAllVariables(FloatDictionary,StringDictionary,BoolDictionary,bool)
SetValue(string,bool)
SetValue(string,float)
SetValue(string,string)
TryGetValue(string,T)

public abstract void SetValue(string variableName, string stringValue);

string variableName

Summary

Parameters

VariableStorageBehaviour

string stringValue

TryGetValue(string,T)

Method in VariableStorageBehaviour

Summary

public abstract bool TryGetValue<T>(string variableName, out T result);

Parameters

Name
Description

string variableName

T result