Skip to content

Commit

Permalink
added compatibility with .Net 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MephestoKhaan committed Jan 10, 2019
1 parent 3abe8a5 commit e335f07
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Assets/EventVisualizer/Editor/EventsVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ private static void AddEventCalls(HashSet<EventCall> 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<UnityEventBase>(obj)) {
Expand Down

0 comments on commit e335f07

Please sign in to comment.