Class PersistentVariablesSource
Can be used to provide global or local values that do not need to be passed in as arguments when formatting a string. The smart string should take the format {groupName.variableName}. e.g {global.player-score}. Note: The group name and variable names must not contain any spaces.
Namespace: UnityEngine .Localization.SmartFormat .Extensions
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public class PersistentVariablesSource : ISource, ISerializationCallbackReceiver
Constructors
Name | Description |
---|---|
Persistent |
Creates a new instance and adds the "." operator to the parser. |
Properties
Name | Description |
---|---|
Count | The number of Variables |
Is |
Implmented as part of IDictionary but not used. Will always return false. |
Is |
Has Begin |
this[string] | Returns the global variable group that matches |
Keys | Returns the global variable group names. |
Values | Returns the global variable groups for this source. |
Methods
Name | Description |
---|---|
Add(Key |
Add a global variable group to the source. |
Add(string, Variables |
Add a global variable group to the source. |
Begin |
Indicates that multiple IVariable will be changed and Localized |
Clear() | Removes all global variables. |
Contains(Key |
Returns true if a global variable group is found with the same name. |
Contains |
Returns true if a global variable group is found with the same name. |
Copy |
Copy all global variable groups into the provided array starting at |
End |
Indicates that updates to IVariable have finished and sends the End |
Get |
Returns an enumerator for all the global variables in the source. |
Remove(Key |
Removes the group with the matching name. |
Remove(string) | Removes the group with the matching name. |
Try |
Evaluates the ISelector |
Try |
Returns true if a global variable group could be found with a matching name, or false if one could not. |
Update |
Can be used to create a Begin |
Events
Name | Description |
---|---|
End |
Called after the final End |