Browse Source

Fix for uninitialized string value

Something weird going on with serialisation of strings.
master
Christopher 9 years ago
parent
commit
f3d094c908
  1. 12
      Assets/Fungus/Flowchart/Scripts/VariableTypes/StringVariable.cs

12
Assets/Fungus/Flowchart/Scripts/VariableTypes/StringVariable.cs

@ -58,7 +58,11 @@ namespace Fungus
public string Value
{
get { return (stringRef == null) ? stringVal : stringRef.value; }
get
{
if (stringVal == null) stringVal = "";
return (stringRef == null) ? stringVal : stringRef.value;
}
set { if (stringRef == null) { stringVal = value; } else { stringRef.value = value; } }
}
@ -104,7 +108,11 @@ namespace Fungus
public string Value
{
get { return (stringRef == null) ? stringVal : stringRef.value; }
get
{
if (stringVal == null) stringVal = "";
return (stringRef == null) ? stringVal : stringRef.value;
}
set { if (stringRef == null) { stringVal = value; } else { stringRef.value = value; } }
}

Loading…
Cancel
Save