InMemoryVariableStorage
Class in Yarn.Unity
Inherits from VariableStorageBehaviour
Summary
A simple implementation of VariableStorageBehaviour.
public class InMemoryVariableStorage : VariableStorageBehaviour, IEnumerable<KeyValuePair<string, object>>Remarks
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:
// 'storage' is an InMemoryVariableStorage
foreach (var variable in storage) {
string name = variable.Key;
System.Object value = variable.Value;
}
Fields
| Name | Description |
|---|---|
| showDebug |
Methods
| Name | Description |
|---|---|
| Clear() | Removes all variables from storage. |
| Contains(string) | returns a boolean value representing if the particular variable is inside the variable storage |
| GetAllVariables() | |
| GetDebugList() | |
| SetAllVariables(Dictionary<string, float>,Dictionary<string, string>,Dictionary<string, bool>,bool) | |
| SetValue(string,bool) | |
| SetValue(string,float) | |
| SetValue(string,string) | |
| TryGetValue |