Browse Source

Fixed private Flowchart variables not substituting correctly

master
Christopher 9 years ago
parent
commit
a806880acc
  1. 7
      Assets/Fungus/Flowchart/Scripts/Flowchart.cs

7
Assets/Fungus/Flowchart/Scripts/Flowchart.cs

@ -1030,6 +1030,8 @@ namespace Fungus
// Instantiate the regular expression object. // Instantiate the regular expression object.
Regex r = new Regex("{\\$.*?}"); Regex r = new Regex("{\\$.*?}");
bool changed = false;
// Match the regular expression pattern against a text string. // Match the regular expression pattern against a text string.
var results = r.Matches(input); var results = r.Matches(input);
foreach (Match match in results) foreach (Match match in results)
@ -1047,12 +1049,15 @@ namespace Fungus
{ {
string value = variable.ToString(); string value = variable.ToString();
sb.Replace(match.Value, value); sb.Replace(match.Value, value);
changed = true;
} }
} }
} }
// Now do all other substitutions in the scene // Now do all other substitutions in the scene
if (stringSubstituer.SubstituteStrings(sb)) changed |= stringSubstituer.SubstituteStrings(sb);
if (changed)
{ {
return sb.ToString(); return sb.ToString();
} }

Loading…
Cancel
Save