Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
public override void Clear()public string GetDebugList()Class in Yarn.Unity
Inherits from VariableStorageBehaviour
A simple implementation of VariableStorageBehaviour.
This class stores variables in memory, and is erased when the game exits.
This class also has basic serialization and save/load example functions.
You can also enumerate over the variables by using a foreach loop:
Note that as of v2.0, this class no longer uses Yarn.Value, to enforce static typing of declared variables within the Yarn Program.
Method in InMemoryVariableStorage
returns a boolean value representing if the particular variable is inside the variable storage
public override bool Contains(string variableName)public class InMemoryVariableStorage : VariableStorageBehaviour, IEnumerable<KeyValuePair<string, object>>string variableName
Retrieves a Value by name.
Removes all variables from storage.
returns a boolean value representing if the particular variable is inside the variable storage
// 'storage' is an InMemoryVariableStorage
foreach (var variable in storage) {
string name = variable.Key;
System.Object value = variable.Value;
}Method in InMemoryVariableStorage
public override void SetValue(string variableName, float floatValue)Method in InMemoryVariableStorage
public override void SetValue(string variableName, bool boolValue)Method in InMemoryVariableStorage
public override void SetValue(string variableName, string stringValue)string variableName
float floatValue
string variableName
bool boolValue
string variableName
string stringValue
Dictionary<string, float> floats
Dictionary<string, string> strings
Dictionary<string, bool> bools
bool clear
public override void SetAllVariables(Dictionary<string, float> floats, Dictionary<string, string> strings, Dictionary<string, bool> bools, bool clear = true)public override (Dictionary<string, float>, Dictionary<string, string>, Dictionary<string, bool>) GetAllVariables()Method in InMemoryVariableStorage
Retrieves a Value by name.
public override bool TryGetValue<T>(string variableName, out T result)The Value . If a variable by the name of variableName is not present, returns a value representing null.
string variableName
The name of the variable to retrieve the value of. Don't forget to include the "$" at the beginning!
T result