From e335f074ca7690d271712a2b15448ebe42ba9978 Mon Sep 17 00:00:00 2001 From: LucaMefisto Date: Thu, 10 Jan 2019 13:48:30 +0100 Subject: [PATCH] added compatibility with .Net 3.5 --- Assets/EventVisualizer/Editor/EventsVisualizer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/EventVisualizer/Editor/EventsVisualizer.cs b/Assets/EventVisualizer/Editor/EventsVisualizer.cs index d316da4..eb01723 100644 --- a/Assets/EventVisualizer/Editor/EventsVisualizer.cs +++ b/Assets/EventVisualizer/Editor/EventsVisualizer.cs @@ -95,10 +95,16 @@ private static void AddEventCalls(HashSet calls, Component caller, Un [DidReloadScripts, InitializeOnLoadMethod] static void RefreshTypesThatCanHoldUnityEvents() { var sw = System.Diagnostics.Stopwatch.StartNew(); - + +#if NET_4_6 var objects = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic) .SelectMany(a => a.GetTypes()) .Where(t => typeof(Component).IsAssignableFrom(t)); +#else + var objects = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(a => a.GetTypes()) + .Where(t => typeof(Component).IsAssignableFrom(t)); +#endif foreach (var obj in objects) { if (RecursivelySearchFields(obj)) {