Skip to content

Commit

Permalink
Fix issue that Methods dont get added
Browse files Browse the repository at this point in the history
  • Loading branch information
jokoho48 authored Feb 27, 2018
1 parent c03da22 commit f5bd17f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/OpenTerminal/Scripts/TerminalMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ public TerminalMethods()
{
methods = new List<MethodInfo>();

foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
foreach (var method in assembly.GetTypes().SelectMany(x => x.GetMethods()).Where(y => y.GetCustomAttributes(true).OfType<TerminalCommandAttribute>().Any()).ToList())
{
methods.Add(method)
foreach (var attribute in method.GetCustomAttributes(true))
{
if (attribute is TerminalCommandAttribute) //Does not pass
Expand All @@ -31,4 +32,4 @@ public string[] GetCommandsContaining(string input)
{
return methodNames.Where(k => k.Contains(input)).ToArray();
}
}
}

0 comments on commit f5bd17f

Please sign in to comment.