diff --git a/Assets/Fungus/Scripts/Editor/BlockEditor.cs b/Assets/Fungus/Scripts/Editor/BlockEditor.cs index 412fe4888..04e178b0e 100644 --- a/Assets/Fungus/Scripts/Editor/BlockEditor.cs +++ b/Assets/Fungus/Scripts/Editor/BlockEditor.cs @@ -72,9 +72,9 @@ protected void CacheCallerString() .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"; diff --git a/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs b/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs index fcc6cd150..fc594466c 100644 --- a/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs +++ b/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs @@ -317,14 +317,20 @@ private void FindUsage(Variable variable) { var varRefs = EditorExtensions.FindObjectsOfInterface() .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); }