Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Method in InMemoryVariableStorage
returns a boolean value representing if the particular variable is inside the variable storage
Name | Description |
---|---|
string
variableName
Method in InMemoryVariableStorage
Load JSON data from Unity's built-in PlayerPrefs with default playerPrefsKey, and deserialize as variables.
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
Load JSON data from Unity's built-in PlayerPrefs with defined playerPrefsKey parameter, and deserialize as variables.
Method in InMemoryVariableStorage
Serialize all variables to JSON, then write the data to a file.
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Removes all variables from storage.
returns a boolean value representing if the particular variable is inside the variable storage
Import a JSON string into variable storage, like when loading save game data.
Load JSON data from a file, then deserialize as variables.
Load JSON data from Unity's built-in PlayerPrefs with default playerPrefsKey, and deserialize as variables.
Load JSON data from Unity's built-in PlayerPrefs with defined playerPrefsKey parameter, and deserialize as variables.
Serialize all variables to JSON, then write the data to a file.
Serialize all variables to JSON, then save data to Unity's built-in PlayerPrefs with default playerPrefsKey.
Serialize all variables to JSON, then save data to Unity's built-in PlayerPrefs under playerPrefsKey parameter.
Export variable storage to a JSON string, like when writing save game data.
Retrieves a Value
by name.
string
playerPrefsKey
string
filepath
Name | Description |
---|---|
string
variableName
bool
boolValue
Method in InMemoryVariableStorage
Retrieves a Value
by name.
The Value
. If a variable by the name of variableName
is not present, returns a value representing null
.
Name | Description |
---|---|
string
variableName
The name of the variable to retrieve the value of. Don't forget to include the "$" at the beginning!
T
result
Method in InMemoryVariableStorage
Load JSON data from a file, then deserialize as variables.
Name | Description |
---|---|
string
filepath
Method in InMemoryVariableStorage
Import a JSON string into variable storage, like when loading save game data.
Name | Description |
---|---|
string
jsonData
Method in InMemoryVariableStorage
Serialize all variables to JSON, then save data to Unity's built-in PlayerPrefs with default playerPrefsKey.
Method in InMemoryVariableStorage
Serialize all variables to JSON, then save data to Unity's built-in PlayerPrefs under playerPrefsKey parameter.
Name | Description |
---|---|
string
playerPrefsKey
Method in InMemoryVariableStorage
Export variable storage to a JSON string, like when writing save game data.
Name | Description |
---|---|
bool
prettyPrint
Name | Description |
---|---|
string
variableName
float
floatValue
Name | Description |
---|---|
string
variableName
string
stringValue