Skip to content

Commit

Permalink
Block and Variable reference string formating moved to arrays rather …
Browse files Browse the repository at this point in the history
…than lists for back compat
  • Loading branch information
stevehalliwell committed Dec 8, 2019
1 parent e301c6a commit 5a6b4f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Assets/Fungus/Scripts/Editor/BlockEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
16 changes: 11 additions & 5 deletions Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,20 @@ private void FindUsage(Variable variable)
{
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);
}
Expand Down

0 comments on commit 5a6b4f4

Please sign in to comment.