Tuesday, 7 April 2015

c# dictionary add if not exist


if (variables == null)
{
variables = new Dictionary<string, object>();
}
if(variables.ContainsKey(name))
{
variables[name] = value;
}
else
{
Debug.LogError("Added new Data to Global Data"+value);
variables.Add(name,value);
}
view raw gistfile1.cs hosted with ❤ by GitHub