class in Unity.SmartStrings.Extensions
Implements interfaces:ISerializationCallbackReceiver, ISource
Provides 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.
| Property | Description |
|---|---|
| IsUpdating | Whether PersistentVariablesSource.BeginUpdating has been called without a matching PersistentVariablesSource.EndUpdating. This can be used when updating the value of multiple IVariable in order to do a single update after the updates instead of 1 per change. |
| Property | Description |
|---|---|
| Count | The number of VariablesGroupAsset that are used for global variables. |
| IsReadOnly | Implemented as part of IDictionary but not used. Always returns false. |
| Keys | The global variable group names. |
| this[string] | The global variable group that matches name. |
| Values | The global variable groups in this source. |
| Method | Description |
|---|---|
| Add | Adds a global variable group to the source. |
| Clear | Removes all global variables. |
| ContainsKey | Returns true if a global variable group is found with the same name. |
| CopyTo | Copies all global variable groups into the provided array starting at arrayIndex. |
| GetEnumerator | Returns an enumerator for all the global variables in the source. |
| Remove | Removes the group with the matching name. |
| TryGetValue | Returns true if a global variable group could be found with a matching name, or false if one could not. |
| Method | Description |
|---|---|
| BeginUpdating | Indicates that multiple IVariable will be changed and localized string should wait for PersistentVariablesSource.EndUpdate before updating. See PersistentVariablesSource.EndUpdating and PersistentVariablesSource.EndUpdate. Note: PersistentVariablesSource.BeginUpdating and PersistentVariablesSource.EndUpdating can be nested, PersistentVariablesSource.EndUpdate will only be called after the last PersistentVariablesSource.EndUpdating. |
| EndUpdating | Indicates that updates to IVariable have finished and sends the PersistentVariablesSource.EndUpdate event. Note: PersistentVariablesSource.BeginUpdating and PersistentVariablesSource.EndUpdating can be nested, PersistentVariablesSource.EndUpdate will only be called after the last PersistentVariablesSource.EndUpdating. |
| UpdateScope | Creates a PersistentVariablesSource.BeginUpdating and PersistentVariablesSource.EndUpdating scope. |
| Event | Description |
|---|---|
| EndUpdate | Raised after the final PersistentVariablesSource.EndUpdating call. This can be used when you wish to respond to value change events but wish to do a single update at the end instead of 1 per change. For example, if you wanted to change the value of multiple global variables that a smart string was using then changing each value would result in a new string being generated, by using begin and end the string generation can be deferred until the final change so that only 1 update is performed. |