Browse Source

Block and Variable reference string formating moved to arrays rather than lists for back compat

master
Steve Halliwell 5 years ago
parent
commit
5a6b4f4d2c
  1. 4
      Assets/Fungus/Scripts/Editor/BlockEditor.cs
  2. 16
      Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs

4
Assets/Fungus/Scripts/Editor/BlockEditor.cs

@ -72,9 +72,9 @@ namespace Fungus.EditorUtils
.Where(x => x is IBlockCaller) .Where(x => x is IBlockCaller)
.Select(x => x as IBlockCaller) .Select(x => x as IBlockCaller)
.Where(x => x.MayCallBlock(targetBlock)) .Where(x => x.MayCallBlock(targetBlock))
.Select(x => x.GetLocationIdentifier()).ToList(); .Select(x => x.GetLocationIdentifier()).ToArray();
if (callers.Count > 0) if (callers != null && callers.Length > 0)
callersString = string.Join("\n", callers); callersString = string.Join("\n", callers);
else else
callersString = "None"; callersString = "None";

16
Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs

@ -317,14 +317,20 @@ namespace Fungus.EditorUtils
{ {
var varRefs = EditorExtensions.FindObjectsOfInterface<IVariableReference>() var varRefs = EditorExtensions.FindObjectsOfInterface<IVariableReference>()
.Where(x => x.HasReference(variable)) .Where(x => x.HasReference(variable))
.Select(x => x.GetLocationIdentifier()).ToList(); ; .Select(x => x.GetLocationIdentifier()).ToArray(); ;
string varRefString = variable.Key + " referenced in;\n"; string varRefString = variable.Key;
if (varRefs.Count > 0) if (varRefs != null && varRefs.Length > 0)
varRefString += string.Join("\n", varRefs); {
varRefString += " referenced in " + varRefs.Length.ToString() + " places:\n";
varRefString += string.Join("\n - ", varRefs);
}
else else
varRefString += "None"; {
varRefString += ", found no references.";
}
Debug.Log(varRefString); Debug.Log(varRefString);
} }

Loading…
Cancel
Save