| Parameter | Description |
|---|---|
| name | The variable name to look for. |
bool
true when a variable is stored under the name; otherwise, false.
Determines whether a variable is stored under the given name.
Lookup is case-sensitive and matches the whitespace-normalized name assigned by LocalVariablesGroup.Add.
<para>Check whether a variable exists before using it.</para>
using Unity.Localization; using Unity.SmartStrings.PersistentVariables; using UnityEngine;
namespace Unity.Localization.Samples { public class LocalVariablesGroupContainsNameExample { public void Check() { var group = new LocalVariablesGroup(); group.Add(new IntVariable { Value = 5 }, "score"); if (group.ContainsName("score")) Debug.Log("Score variable is set."); } } }