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)
.Select(x => x as IBlockCaller)
.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);
else
callersString = "None";

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

@ -317,14 +317,20 @@ namespace Fungus.EditorUtils
{
var varRefs = EditorExtensions.FindObjectsOfInterface<IVariableReference>()
.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)
varRefString += string.Join("\n", varRefs);
if (varRefs != null && varRefs.Length > 0)
{
varRefString += " referenced in " + varRefs.Length.ToString() + " places:\n";
varRefString += string.Join("\n - ", varRefs);
}
else
varRefString += "None";
{
varRefString += ", found no references.";
}
Debug.Log(varRefString);
}

Loading…
Cancel
Save